From: Len Brown <lenb@kernel.org>
To: linux-pm@vger.kernel.org
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
Len Brown <len.brown@intel.com>
Subject: [PATCH 6/9] tools/power turbostat: Fix incorrect format variable
Date: Fri, 10 Apr 2026 09:25:11 -0400 [thread overview]
Message-ID: <23cb4f5c81766e70e5f32ed0987ee8fb5ab2e00a.1775827309.git.len.brown@intel.com> (raw)
In-Reply-To: <57d2371d52be1d574b33382bfbf8052485b99d8b.1775827309.git.len.brown@intel.com>
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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: 696d15cbd8c2 ("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>
---
tools/power/x86/turbostat/turbostat.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 9744f9caac9a..4d954533c71d 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -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));
--
2.45.2
next prev parent reply other threads:[~2026-04-10 13:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 13:25 [PATCH 0/9] turbostat fixes for 7.0 Len Brown
2026-04-10 13:25 ` [PATCH 1/9] tools/power turbostat: Fix illegal memory access when SMT is present and disabled Len Brown
2026-04-10 13:25 ` [PATCH 2/9] tools/power turbostat: Fix swidle header vs data display Len Brown
2026-04-10 13:25 ` [PATCH 3/9] tools/power turbostat: Eliminate unnecessary data structure allocation Len Brown
2026-04-10 13:25 ` [PATCH 4/9] tools/power/turbostat: Fix microcode patch level output for AMD/Hygon Len Brown
2026-04-10 13:25 ` [PATCH 5/9] tools/power turbostat: Consistently use print_float_value() Len Brown
2026-04-10 13:25 ` Len Brown [this message]
2026-04-10 13:25 ` [PATCH 7/9] tools/power turbostat: Fix --show/--hide for individual cpuidle counters Len Brown
2026-04-10 13:25 ` [PATCH 8/9] tools/power turbostat: Fix delimiter bug in print functions Len Brown
2026-04-10 13:25 ` [PATCH 9/9] tools/power turbostat: Allow execution to continue after perf_l2_init() failure Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23cb4f5c81766e70e5f32ed0987ee8fb5ab2e00a.1775827309.git.len.brown@intel.com \
--to=lenb@kernel.org \
--cc=artem.bityutskiy@linux.intel.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox