mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 06:41:39 -04:00
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: 696d15cbd8 ("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>
This commit is contained in:
committed by
Len Brown
parent
ed532d738a
commit
23cb4f5c81
@@ -3468,7 +3468,7 @@ int format_counters(PER_THREAD_PARAMS)
|
||||
for (i = 0, pp = sys.perf_tp; pp; ++i, pp = pp->next) {
|
||||
if (pp->format == FORMAT_RAW)
|
||||
outp += print_hex_value(pp->width, &printed, delim, t->perf_counter[i]);
|
||||
else if (pp->format == FORMAT_DELTA || mp->format == FORMAT_AVERAGE)
|
||||
else if (pp->format == FORMAT_DELTA || pp->format == FORMAT_AVERAGE)
|
||||
outp += print_decimal_value(pp->width, &printed, delim, t->perf_counter[i]);
|
||||
else if (pp->format == FORMAT_PERCENT) {
|
||||
if (pp->type == COUNTER_USEC)
|
||||
@@ -3538,7 +3538,7 @@ int format_counters(PER_THREAD_PARAMS)
|
||||
for (i = 0, pp = sys.perf_cp; pp; i++, pp = pp->next) {
|
||||
if (pp->format == FORMAT_RAW)
|
||||
outp += print_hex_value(pp->width, &printed, delim, c->perf_counter[i]);
|
||||
else if (pp->format == FORMAT_DELTA || mp->format == FORMAT_AVERAGE)
|
||||
else if (pp->format == FORMAT_DELTA || pp->format == FORMAT_AVERAGE)
|
||||
outp += print_decimal_value(pp->width, &printed, delim, c->perf_counter[i]);
|
||||
else if (pp->format == FORMAT_PERCENT)
|
||||
outp += print_float_value(&printed, delim, pct(c->perf_counter[i], tsc));
|
||||
@@ -3694,7 +3694,7 @@ int format_counters(PER_THREAD_PARAMS)
|
||||
outp += print_hex_value(pp->width, &printed, delim, p->perf_counter[i]);
|
||||
else if (pp->type == COUNTER_K2M)
|
||||
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), (unsigned int)p->perf_counter[i] / 1000);
|
||||
else if (pp->format == FORMAT_DELTA || mp->format == FORMAT_AVERAGE)
|
||||
else if (pp->format == FORMAT_DELTA || pp->format == FORMAT_AVERAGE)
|
||||
outp += print_decimal_value(pp->width, &printed, delim, p->perf_counter[i]);
|
||||
else if (pp->format == FORMAT_PERCENT)
|
||||
outp += print_float_value(&printed, delim, pct(p->perf_counter[i], tsc));
|
||||
|
||||
Reference in New Issue
Block a user