]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/power turbostat: Print core_id and apic_id in hex
authorLen Brown <len.brown@intel.com>
Tue, 24 Mar 2026 23:31:50 +0000 (19:31 -0400)
committerLen Brown <len.brown@intel.com>
Wed, 22 Apr 2026 15:31:57 +0000 (11:31 -0400)
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@intel.com>
tools/power/x86/turbostat/turbostat.c

index 624f54ee1ad82ba3ccd16251968f9d302107cee6..b27227414dc73181b7f38fd0aa5131b3189f3c21 100644 (file)
@@ -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))