[PATCH 07/13] tools/power turbostat: Print core_id and apic_id in hex
From: Len Brown
Date: Sat Apr 25 2026 - 14:50:29 EST
From: Len Brown <len.brown@xxxxxxxxx>
The core_id is based on a mask of the apic_id.
Print them both in hex, rather than decimal,
to make this relationship visibly clear.
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
---
tools/power/x86/turbostat/turbostat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 624f54ee1ad8..b27227414dc7 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -3214,7 +3214,7 @@ int dump_counters(PER_THREAD_PARAMS)
}
if (c && is_cpu_first_thread_in_core(t, c)) {
- outp += sprintf(outp, "core: %d\n", cpus[t->cpu_id].core_id);
+ outp += sprintf(outp, "core: 0x%x\n", cpus[t->cpu_id].core_id);
outp += sprintf(outp, "c3: %016llX\n", c->c3);
outp += sprintf(outp, "c6: %016llX\n", c->c6);
outp += sprintf(outp, "c7: %016llX\n", c->c7);
@@ -3423,16 +3423,16 @@ int format_counters(PER_THREAD_PARAMS)
}
if (DO_BIC(BIC_Core)) {
if (c)
- outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), cpus[t->cpu_id].core_id);
+ outp += sprintf(outp, "%s0x%x", (printed++ ? delim : ""), cpus[t->cpu_id].core_id);
else
outp += sprintf(outp, "%s-", (printed++ ? delim : ""));
}
if (DO_BIC(BIC_CPU))
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), t->cpu_id);
if (DO_BIC(BIC_APIC))
- outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), t->apic_id);
+ outp += sprintf(outp, "%s0x%x", (printed++ ? delim : ""), t->apic_id);
if (DO_BIC(BIC_X2APIC))
- outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), t->x2apic_id);
+ outp += sprintf(outp, "%s0x%x", (printed++ ? delim : ""), t->x2apic_id);
}
if (DO_BIC(BIC_Avg_MHz))
--
2.45.2