Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Clark" <james.clark@linaro.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v4] perf tests: mmap-basic: fix user rdpmc detection logic
Date: Mon, 17 Aug 2026 16:05:13 +0000	[thread overview]
Message-ID: <20260817160513.B74611F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817-rdpmc-detection-logic-v4-1-c22074578f6a@linaro.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing explicit inclusion of `<unistd.h>` for POSIX libc functions.
--

--- Patch [1]: [PATCH v4] perf tests: mmap-basic: fix user rdpmc detection logic ---
commit 4b703a4e5dfd0ba3b4f770b8ec3924ee647f0a6c
Author: Qiao Zhao <qzhao@redhat.com>

perf tests: mmap-basic: fix user rdpmc detection logic

This patch introduces a fallback to /proc/sys/kernel/perf_user_access for 
RISC-V and Arm to control userspace counter access in the mmap-basic test. 
It also updates the test logic to support restoring arbitrary values and 
adjusts expectations for Arm platforms.

> diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
> index 5cec7644952c7..4433a5df3d776 100644
> --- a/tools/perf/tests/mmap-basic.c
> +++ b/tools/perf/tests/mmap-basic.c
[ ... ]
> @@ -182,47 +183,77 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
>  }
>  
>  enum user_read_state {
[ ... ]
> +static int set_user_read_fd(int fd, int enabled)
>  {
[ ... ]
> +	if (enabled == old_user_read)
> +		return old_user_read;
> +
> +	len = scnprintf(buf, sizeof(buf), "%d\n", enabled);
> +	if (lseek(fd, 0, SEEK_SET) < 0) {

[Severity: Low]
Does this code build correctly with musl libc?

This patch introduces lseek() and SEEK_SET in set_user_read_fd(), but there
is no explicit include for <unistd.h>. While it currently compiles under
glibc due to implicit includes, relying on this can cause build failures
under musl libc where headers are strictly separated.

Could <unistd.h> be explicitly included alongside the other headers?

> +		pr_debug("%s seek failed\n", __func__);
> +		return old_user_read;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260817-rdpmc-detection-logic-v4-1-c22074578f6a@linaro.org?part=1

      reply	other threads:[~2026-08-17 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 15:54 [PATCH v4] perf tests: mmap-basic: fix user rdpmc detection logic James Clark
2026-08-17 16:05 ` sashiko-bot [this message]

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=20260817160513.B74611F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=james.clark@linaro.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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