Skip to content

Commit 2d2ccd5

Browse files
committed
tools/power turbostat: enhance -D (debug counter dump) output
Eliminate redundant debug output for core and package scope counters. Include name and path for all "ADDED" counters. Signed-off-by: Len Brown <[email protected]>
1 parent b6fe938 commit 2d2ccd5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,11 +1673,13 @@ int dump_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p
16731673
outp += sprintf(outp, "SMI: %d\n", t->smi_count);
16741674

16751675
for (i = 0, mp = sys.tp; mp; i++, mp = mp->next) {
1676-
outp += sprintf(outp, "tADDED [%d] msr0x%x: %08llX\n", i, mp->msr_num, t->counter[i]);
1676+
outp +=
1677+
sprintf(outp, "tADDED [%d] %8s msr0x%x: %08llX %s\n", i, mp->name, mp->msr_num,
1678+
t->counter[i], mp->path);
16771679
}
16781680
}
16791681

1680-
if (c) {
1682+
if (c && is_cpu_first_thread_in_core(t, c, p)) {
16811683
outp += sprintf(outp, "core: %d\n", c->core_id);
16821684
outp += sprintf(outp, "c3: %016llX\n", c->c3);
16831685
outp += sprintf(outp, "c6: %016llX\n", c->c6);
@@ -1687,12 +1689,14 @@ int dump_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p
16871689
outp += sprintf(outp, "Joules: %0X\n", c->core_energy);
16881690

16891691
for (i = 0, mp = sys.cp; mp; i++, mp = mp->next) {
1690-
outp += sprintf(outp, "cADDED [%d] msr0x%x: %08llX\n", i, mp->msr_num, c->counter[i]);
1692+
outp +=
1693+
sprintf(outp, "cADDED [%d] %8s msr0x%x: %08llX %s\n", i, mp->name, mp->msr_num,
1694+
c->counter[i], mp->path);
16911695
}
16921696
outp += sprintf(outp, "mc6_us: %016llX\n", c->mc6_us);
16931697
}
16941698

1695-
if (p) {
1699+
if (p && is_cpu_first_core_in_package(t, c, p)) {
16961700
outp += sprintf(outp, "package: %d\n", p->package_id);
16971701

16981702
outp += sprintf(outp, "Weighted cores: %016llX\n", p->pkg_wtd_core_c0);
@@ -1721,7 +1725,9 @@ int dump_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p
17211725
outp += sprintf(outp, "PTM: %dC\n", p->pkg_temp_c);
17221726

17231727
for (i = 0, mp = sys.pp; mp; i++, mp = mp->next) {
1724-
outp += sprintf(outp, "pADDED [%d] msr0x%x: %08llX\n", i, mp->msr_num, p->counter[i]);
1728+
outp +=
1729+
sprintf(outp, "pADDED [%d] %8s msr0x%x: %08llX %s\n", i, mp->name, mp->msr_num,
1730+
p->counter[i], mp->path);
17251731
}
17261732
}
17271733

0 commit comments

Comments
 (0)