Skip to content

Commit da828b6

Browse files
committed
tools/power turbostat: Print core_id and apic_id in hex
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>
1 parent 092b76a commit da828b6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/power/x86/turbostat/turbostat.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3214,7 +3214,7 @@ int dump_counters(PER_THREAD_PARAMS)
32143214
}
32153215

32163216
if (c && is_cpu_first_thread_in_core(t, c)) {
3217-
outp += sprintf(outp, "core: %d\n", cpus[t->cpu_id].core_id);
3217+
outp += sprintf(outp, "core: 0x%x\n", cpus[t->cpu_id].core_id);
32183218
outp += sprintf(outp, "c3: %016llX\n", c->c3);
32193219
outp += sprintf(outp, "c6: %016llX\n", c->c6);
32203220
outp += sprintf(outp, "c7: %016llX\n", c->c7);
@@ -3423,16 +3423,16 @@ int format_counters(PER_THREAD_PARAMS)
34233423
}
34243424
if (DO_BIC(BIC_Core)) {
34253425
if (c)
3426-
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), cpus[t->cpu_id].core_id);
3426+
outp += sprintf(outp, "%s0x%x", (printed++ ? delim : ""), cpus[t->cpu_id].core_id);
34273427
else
34283428
outp += sprintf(outp, "%s-", (printed++ ? delim : ""));
34293429
}
34303430
if (DO_BIC(BIC_CPU))
34313431
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), t->cpu_id);
34323432
if (DO_BIC(BIC_APIC))
3433-
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), t->apic_id);
3433+
outp += sprintf(outp, "%s0x%x", (printed++ ? delim : ""), t->apic_id);
34343434
if (DO_BIC(BIC_X2APIC))
3435-
outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), t->x2apic_id);
3435+
outp += sprintf(outp, "%s0x%x", (printed++ ? delim : ""), t->x2apic_id);
34363436
}
34373437

34383438
if (DO_BIC(BIC_Avg_MHz))

0 commit comments

Comments
 (0)