Skip to content

Commit f2c1dba

Browse files
committed
tools/power/turbostat: bugfix "--show IPC"
turbostat --show IPC displays "inf" for the IPC column turbostat was missing the explicit dependency of IPC on APERF, and thus neglected to collect APERF when only IPC was requested. typcial use: turbostat --quiet --show CPU,IPC Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 956dbd3 commit f2c1dba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,8 @@ int delta_thread(struct thread_data *new, struct thread_data *old, struct core_d
22022202

22032203
old->c1 = new->c1 - old->c1;
22042204

2205-
if (DO_BIC(BIC_Avg_MHz) || DO_BIC(BIC_Busy) || DO_BIC(BIC_Bzy_MHz) || soft_c1_residency_display(BIC_Avg_MHz)) {
2205+
if (DO_BIC(BIC_Avg_MHz) || DO_BIC(BIC_Busy) || DO_BIC(BIC_Bzy_MHz) || DO_BIC(BIC_IPC)
2206+
|| soft_c1_residency_display(BIC_Avg_MHz)) {
22062207
if ((new->aperf > old->aperf) && (new->mperf > old->mperf)) {
22072208
old->aperf = new->aperf - old->aperf;
22082209
old->mperf = new->mperf - old->mperf;
@@ -2724,7 +2725,8 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
27242725
retry:
27252726
t->tsc = rdtsc(); /* we are running on local CPU of interest */
27262727

2727-
if (DO_BIC(BIC_Avg_MHz) || DO_BIC(BIC_Busy) || DO_BIC(BIC_Bzy_MHz) || soft_c1_residency_display(BIC_Avg_MHz)) {
2728+
if (DO_BIC(BIC_Avg_MHz) || DO_BIC(BIC_Busy) || DO_BIC(BIC_Bzy_MHz) || DO_BIC(BIC_IPC)
2729+
|| soft_c1_residency_display(BIC_Avg_MHz)) {
27282730
unsigned long long tsc_before, tsc_between, tsc_after, aperf_time, mperf_time;
27292731

27302732
/*

0 commit comments

Comments
 (0)