[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJvTdKnBKcXJV5az-2q1MF8b6PU6mxVS2YETgn+OWUKBfOSuZA@mail.gmail.com>
Date: Mon, 1 Dec 2025 15:11:07 -0500
From: Len Brown <lenb@...nel.org>
To: David Arcari <darcari@...hat.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] tools/power turbostat: allow turbostat to work when
aperf is not available
Something like this?
diff --git a/tools/power/x86/turbostat/turbostat.c
b/tools/power/x86/turbostat/turbostat.c
index 5bc47ad5da09..4a847e7e9c65 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -8530,7 +8530,7 @@ void rapl_perf_init(void)
/* Assumes msr_counter_info is populated */
static int has_amperf_access(void)
{
- return msr_counter_arch_infos[MSR_ARCH_INFO_APERF_INDEX].present &&
+ return has_aperf &&
msr_counter_arch_infos[MSR_ARCH_INFO_APERF_INDEX].present &&
msr_counter_arch_infos[MSR_ARCH_INFO_MPERF_INDEX].present;
}
On Mon, Dec 1, 2025 at 2:53 PM Len Brown <lenb@...nel.org> wrote:
>
> > ...add_msr_perf_counter() returns -1
>
> good. and then add_msr_counter() succeeds because...
>
> > rdmsr returns zero for MSR_IA32_APERF and MSR_IA32_MPERF.
>
> Your patch is a good suggestion -- though it checks for APERF only and
> not for MPERF.
>
> We already ran CPUID and cleared has_aperf, so I'm thinking we should
> be heading this off earlier. Let me send you a test patch later today.
>
> thanks,
> Len Brown, Intel Open Source Technology Center
--
Len Brown, Intel Open Source Technology Center
Powered by blists - more mailing lists