From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf test: Fixes for check branch stack sampling
Date: Wed, 08 Apr 2026 06:34:45 +0000 [thread overview]
Message-ID: <20260408063445.91C0CC19424@smtp.kernel.org> (raw)
In-Reply-To: <20260408062048.61252-1-irogers@google.com>
Sashiko AI review found 2 potential issue(s):
- [Medium] Outdated comments and output messages in `test_kernel_branches` explicitly contradict the new test logic and the commit message.
- [Medium] Missing `perf record` output redirection in `test_trap_eret_branches`.
--
commit 123631eaa14de0c5e9e90fa3e9a1064ed9d669af
Author: Ian Rogers <irogers@google.com>
perf test: Fixes for check branch stack sampling
This commit updates branch stack sampling tests to handle user/kernel
boundary crossings. It also increases the duration of the system call
sampling test for reliability, and redirects unneeded perf record output
to a temporary file.
> diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh
> --- a/tools/perf/tests/shell/test_brstack.sh
> +++ b/tools/perf/tests/shell/test_brstack.sh
[ ... ]
> test_trap_eret_branches() {
> echo "Testing trap & eret branches"
> +
> if ! is_arm64; then
> - echo "skip: not arm64"
> + echo "Testing trap & eret branches [Skipped not arm64]"
> + return
> + fi
> + start_err=$err
> + err=0
> + perf record -o $TMPDIR/perf.data --branch-filter any,save_type,u,k -- \
> + perf test -w traploop 1000
The commit message states that unneeded perf record output is put into a
temporary file to avoid cluttering the test output. Was the redirection
intentionally omitted for this specific test?
> + perf script -i $TMPDIR/perf.data --fields brstacksym | \
> + tr ' ' '\n' > $TMPDIR/perf.script
[ ... ]
> test_kernel_branches() {
> echo "Testing that k option only includes kernel source addresses"
Does this output message still reflect the test's intent? The commit message
states that the test now allows the source to be in user land, but this
message says it "only includes kernel source addresses".
>
> - if ! perf record --branch-filter any,k -o- -- true > /dev/null; then
> - echo "skip: not enough privileges"
> + if ! perf record --branch-filter any,k -o- -- true > "$TMPDIR/record.txt" 2>&1; then
> + echo "Testing that k option [Skipped not enough privileges]"
> + return
> + fi
> + start_err=$err
> + err=0
> + perf record -o $TMPDIR/perf.data --branch-filter any,k -- \
> + perf bench syscall basic --loop 1000 > "$TMPDIR/record.txt" 2>&1
> + perf script -i $TMPDIR/perf.data --fields brstack | \
> + tr ' ' '\n' > $TMPDIR/perf.script
> +
> + # Example of branch entries:
> + # "0xffffffff93bda241/0xffffffff93bda20f/M/-/-/..."
> + # Source addresses come first and target address can be either
> + # userspace or kernel even with k option, as long as the source
> + # is in kernel.
This isn't a bug, but this comment appears to contradict the new test logic.
The new test logic below correctly checks that the target address is in the
kernel rather than the source address. Should this comment be updated?
> +
> + # Look for source addresses with top bit set
> + if ! grep -q -E -m1 "^0x[89a-f][0-9a-f]{15}" $TMPDIR/perf.script; then
> + echo "Testing that k option [Failed kernel branches missing]"
> + err=1
> + fi
> + # 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
> + echo "Testing that k option [Failed user branches found with kernel filter]"
> + err=1
> + fi
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260408062048.61252-1-irogers@google.com?part=1
next prev parent reply other threads:[~2026-04-08 6:34 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 [this message]
2026-04-08 6:58 ` [PATCH v3] " Ian Rogers
2026-04-08 7:16 ` sashiko-bot
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=20260408063445.91C0CC19424@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