Commit da828b6c authored by Len Brown's avatar Len Brown
Browse files

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: default avatarLen Brown <len.brown@intel.com>
parent 092b76a3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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))