Skip to content

Commit

Permalink
sadf: PCP: Simplify pcp_def_cpu_metrics() function
Browse files Browse the repository at this point in the history
Variable "first" not needed.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
  • Loading branch information
sysstat committed Mar 23, 2019
1 parent c0f4462 commit 2fd9530
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pcp_def_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
void pcp_def_cpu_metrics(struct activity *a)
{
#ifdef HAVE_PCP
int i, first = TRUE;
int i;
char buf[64];
pmInDom indom;

Expand Down Expand Up @@ -96,10 +96,9 @@ void pcp_def_cpu_metrics(struct activity *a)
pmiUnits(0, 0, 0, 0, 0, 0));
}
else {
if (first) {
first = FALSE;

if (i == 1) {
indom = pmInDom_build(0, 0);

pmiAddMetric("kernel.percpu.cpu.user",
PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT,
pmiUnits(0, 0, 0, 0, 0, 0));
Expand Down

0 comments on commit 2fd9530

Please sign in to comment.