From: "Zhang, Rui" <rui.zhang@intel.com>
To: "calvin@wbinvd.org" <calvin@wbinvd.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [PATCH] tools/power turbostat: Fix MSRs with CONFIG_MULTIUSER=n
Date: Mon, 16 Jun 2025 01:30:25 +0000 [thread overview]
Message-ID: <99f09d35e30fa335508823e9848a3365936ac9b3.camel@intel.com> (raw)
In-Reply-To: <81f4c402d1fda7c2419aac1148061a0789112e76.1749849645.git.calvin@wbinvd.org>
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@wbinvd.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;
next prev parent reply other threads:[~2025-06-16 1:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-14 2:20 [PATCH] tools/power turbostat: Fix MSRs with CONFIG_MULTIUSER=n Calvin Owens
2025-06-16 1:30 ` Zhang, Rui [this message]
2025-06-16 4:38 ` Calvin Owens
2025-06-16 4:44 ` Calvin Owens
2025-06-18 3:28 ` Zhang, Rui
2025-06-18 14:32 ` Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99f09d35e30fa335508823e9848a3365936ac9b3.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=calvin@wbinvd.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox