Skip to content

Commit ea8614c

Browse files
Patryk Wlazlynlenb
authored andcommitted
tools/power turbostat: Fix column printing for PMT xtal_time counters
If the very first printed column was for a PMT counter of type xtal_time we would misalign the column header, because we were always printing the delimiter. Signed-off-by: Patryk Wlazlyn <[email protected]> Signed-off-by: Len Brown <[email protected]>
1 parent d4a0587 commit ea8614c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,7 +2291,7 @@ void print_header(char *delim)
22912291
break;
22922292

22932293
case PMT_TYPE_XTAL_TIME:
2294-
outp += sprintf(outp, "%s%s", delim, ppmt->name);
2294+
outp += sprintf(outp, "%s%s", (printed++ ? delim : ""), ppmt->name);
22952295
break;
22962296
}
22972297

@@ -2365,7 +2365,7 @@ void print_header(char *delim)
23652365
break;
23662366

23672367
case PMT_TYPE_XTAL_TIME:
2368-
outp += sprintf(outp, "%s%s", delim, ppmt->name);
2368+
outp += sprintf(outp, "%s%s", (printed++ ? delim : ""), ppmt->name);
23692369
break;
23702370
}
23712371

@@ -2496,7 +2496,7 @@ void print_header(char *delim)
24962496
break;
24972497

24982498
case PMT_TYPE_XTAL_TIME:
2499-
outp += sprintf(outp, "%s%s", delim, ppmt->name);
2499+
outp += sprintf(outp, "%s%s", (printed++ ? delim : ""), ppmt->name);
25002500
break;
25012501
}
25022502

0 commit comments

Comments
 (0)