[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99f09d35e30fa335508823e9848a3365936ac9b3.camel@intel.com>
Date: Mon, 16 Jun 2025 01:30:25 +0000
From: "Zhang, Rui" <rui.zhang@...el.com>
To: "calvin@...nvd.org" <calvin@...nvd.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>, "lenb@...nel.org"
<lenb@...nel.org>
Subject: Re: [PATCH] tools/power turbostat: Fix MSRs with CONFIG_MULTIUSER=n
On Fri, 2025-06-13 at 19:20 -0700, Calvin Owens wrote:
> Handle ENOSYS from cap_get_proc() in check_for_cap_sys_rawio(), so
> turbostat can display temperatures when running on kernels compiled
> without multiuser support.
>
> Signed-off-by: Calvin Owens <calvin@...nvd.org>
> ---
> tools/power/x86/turbostat/turbostat.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/power/x86/turbostat/turbostat.c
> b/tools/power/x86/turbostat/turbostat.c
> index 925556b90770..f7d665913a52 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -6496,8 +6496,13 @@ int check_for_cap_sys_rawio(void)
> int ret = 0;
>
> caps = cap_get_proc();
> - if (caps == NULL)
> + if (caps == NULL) {
> + /* Support CONFIG_MULTIUSER=n */
> + if (errno == ENOSYS)
Can you point me where this knowledge comes from?
I downloaded the libcap source and didn't see how ENOSYS is set.
thanks,
rui
> + return 0;
> +
> return 1;
> + }
>
> if (cap_get_flag(caps, CAP_SYS_RAWIO, CAP_EFFECTIVE,
> &cap_flag_value)) {
> ret = 1;
Powered by blists - more mailing lists