Skip to content

Commit 57b5378

Browse files
zhang-ruilenb
authored andcommitted
tools/power turbostat: Quit early for unsupported RAPL counters
Quit early for unsupported RAPL counters. No functional change. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent fdea6b8 commit 57b5378

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7948,6 +7948,9 @@ void rapl_perf_init(void)
79487948
enum rapl_unit unit;
79497949
unsigned int next_domain;
79507950

7951+
if (!BIC_IS_ENABLED(cai->bic))
7952+
continue;
7953+
79517954
memset(domain_visited, 0, num_domains * sizeof(*domain_visited));
79527955

79537956
for (int cpu = 0; cpu < topo.max_cpu_num + 1; ++cpu) {
@@ -7971,7 +7974,7 @@ void rapl_perf_init(void)
79717974
struct rapl_counter_info_t *rci = &rapl_counter_info_perdomain[next_domain];
79727975

79737976
/* Check if the counter is enabled and accessible */
7974-
if (BIC_IS_ENABLED(cai->bic) && (platform->rapl_msrs & cai->feature_mask)) {
7977+
if (platform->rapl_msrs & cai->feature_mask) {
79757978

79767979
/* Use perf API for this counter */
79777980
if (!no_perf && cai->perf_name

0 commit comments

Comments
 (0)