Skip to content

Commit 23cb4f5

Browse files
dedekindlenb
authored andcommitted
tools/power turbostat: Fix incorrect format variable
In the perf thread, core, and package counter loops, an incorrect 'mp->format' variable is used instead of 'pp->format'. [lenb: edit commit message] Fixes: 696d15c ("tools/power turbostat: Refactor floating point printout code") Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent ed532d7 commit 23cb4f5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,7 +3468,7 @@ int format_counters(PER_THREAD_PARAMS)
34683468
for (i = 0, pp = sys.perf_tp; pp; ++i, pp = pp->next) {
34693469
if (pp->format == FORMAT_RAW)
34703470
outp += print_hex_value(pp->width, &printed, delim, t->perf_counter[i]);
3471-
else if (pp->format == FORMAT_DELTA || mp->format == FORMAT_AVERAGE)
3471+
else if (pp->format == FORMAT_DELTA || pp->format == FORMAT_AVERAGE)
34723472
outp += print_decimal_value(pp->width, &printed, delim, t->perf_counter[i]);
34733473
else if (pp->format == FORMAT_PERCENT) {
34743474
if (pp->type == COUNTER_USEC)
@@ -3538,7 +3538,7 @@ int format_counters(PER_THREAD_PARAMS)
35383538
for (i = 0, pp = sys.perf_cp; pp; i++, pp = pp->next) {
35393539
if (pp->format == FORMAT_RAW)
35403540
outp += print_hex_value(pp->width, &printed, delim, c->perf_counter[i]);
3541-
else if (pp->format == FORMAT_DELTA || mp->format == FORMAT_AVERAGE)
3541+
else if (pp->format == FORMAT_DELTA || pp->format == FORMAT_AVERAGE)
35423542
outp += print_decimal_value(pp->width, &printed, delim, c->perf_counter[i]);
35433543
else if (pp->format == FORMAT_PERCENT)
35443544
outp += print_float_value(&printed, delim, pct(c->perf_counter[i], tsc));
@@ -3694,7 +3694,7 @@ int format_counters(PER_THREAD_PARAMS)
36943694
outp += print_hex_value(pp->width, &printed, delim, p->perf_counter[i]);
36953695
else if (pp->type == COUNTER_K2M)
36963696
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), (unsigned int)p->perf_counter[i] / 1000);
3697-
else if (pp->format == FORMAT_DELTA || mp->format == FORMAT_AVERAGE)
3697+
else if (pp->format == FORMAT_DELTA || pp->format == FORMAT_AVERAGE)
36983698
outp += print_decimal_value(pp->width, &printed, delim, p->perf_counter[i]);
36993699
else if (pp->format == FORMAT_PERCENT)
37003700
outp += print_float_value(&printed, delim, pct(p->perf_counter[i], tsc));

0 commit comments

Comments
 (0)