public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3] perf test: Fixes for check branch stack sampling
Date: Wed, 08 Apr 2026 07:16:47 +0000	[thread overview]
Message-ID: <20260408071648.389A6C19424@smtp.kernel.org> (raw)
In-Reply-To: <20260408065841.165393-1-irogers@google.com>

Sashiko AI review found 1 potential issue(s):
- [Medium] Incomplete regex in `test_kernel_branches` misses user branch target addresses that don't start with 0-7, causing false negatives.
--

commit 81a20991ebd7cf4f6e494b9b81ee11052acea653
Author: Ian Rogers <irogers@google.com>

perf test: Fixes for check branch stack sampling

This commit fixes and expands the branch stack sampling tests in perf.
It updates user and kernel branch filters to properly check source and target
addresses, increases system call sampling duration for reliability, and cleans
up test output.

> diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh
> index 85233d435be63..025ed9d3d1105 100755
> --- a/tools/perf/tests/shell/test_brstack.sh
> +++ b/tools/perf/tests/shell/test_brstack.sh
[ ... ]
> @@ -73,59 +75,80 @@ test_user_branches() {
[ ... ]
>  test_kernel_branches() {
[ ... ]
> +	# Look for no target addresses without top bit set
> +	if grep -q -E -m1 "^0x[0-9a-f]{0,16}/0x[0-7][0-9a-f]{0,15}/" $TMPDIR/perf.script; then

Does this regex reliably match all user space target addresses?

Because perf script prints brstack addresses without zero-padding, a valid
32-bit user address like 0x8048000 begins with 8 but is much shorter than
16 characters.

Since the regex strictly requires the first character after the prefix to be
between 0 and 7, it seems like it might silently miss shorter user addresses
that start with 8 through f, potentially causing the test to pass when it
should fail.

> +		echo "Testing kernel branch sampling [Failed user branches found]"
> +		err=1
> +	fi

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260408065841.165393-1-irogers@google.com?part=1

  reply	other threads:[~2026-04-08  7:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  6:03 [PATCH v1] perf test: Fixes for check branch stack sampling Ian Rogers
2026-04-08  6:12 ` sashiko-bot
2026-04-08  6:20   ` [PATCH v2] " Ian Rogers
2026-04-08  6:34     ` sashiko-bot
2026-04-08  6:58     ` [PATCH v3] " Ian Rogers
2026-04-08  7:16       ` sashiko-bot [this message]
2026-04-08  7:40         ` Ian Rogers

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=20260408071648.389A6C19424@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko@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