Skip to content

Commit

Permalink
tools/power turbostat: fix dump for AMD cpus
Browse files Browse the repository at this point in the history
turbostat --Dump exits early with status 243 (-13)

get_counters() calls get_msr_sum() on zen CPUS
for MSR_PKG_ENERGY_STAT, but per_cpu_msr_sum
has not been initialized.

Signed-off-by: Dan Merillat <git@dan.eginity.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Dan Merillat authored and Len Brown committed Apr 17, 2022
1 parent 5dc241f commit 6799ba8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -6437,6 +6437,8 @@ int main(int argc, char **argv)

turbostat_init();

msr_sum_record();

/* dump counters and exit */
if (dump_only)
return get_and_dump_counters();
Expand All @@ -6448,7 +6450,6 @@ int main(int argc, char **argv)
return 0;
}

msr_sum_record();
/*
* if any params left, it must be a command to fork
*/
Expand Down

0 comments on commit 6799ba8

Please sign in to comment.