From: Zhang Rui Date: Sat, 17 May 2025 02:26:14 +0000 (+0800) Subject: tools/power turbostat: Quit early for unsupported RAPL counters X-Git-Tag: v6.16-rc1~1^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57b53787f0f7845eb30aedde75464aca37906985;p=thirdparty%2Fkernel%2Flinux.git tools/power turbostat: Quit early for unsupported RAPL counters Quit early for unsupported RAPL counters. No functional change. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 69c19e01b681..7e7d25d2362a 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -7948,6 +7948,9 @@ void rapl_perf_init(void) enum rapl_unit unit; unsigned int next_domain; + if (!BIC_IS_ENABLED(cai->bic)) + continue; + memset(domain_visited, 0, num_domains * sizeof(*domain_visited)); for (int cpu = 0; cpu < topo.max_cpu_num + 1; ++cpu) { @@ -7971,7 +7974,7 @@ void rapl_perf_init(void) struct rapl_counter_info_t *rci = &rapl_counter_info_perdomain[next_domain]; /* Check if the counter is enabled and accessible */ - if (BIC_IS_ENABLED(cai->bic) && (platform->rapl_msrs & cai->feature_mask)) { + if (platform->rapl_msrs & cai->feature_mask) { /* Use perf API for this counter */ if (!no_perf && cai->perf_name