From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: bpf@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 5/7] perf test: Enhance annotate test coverage and isolate config
Date: Tue, 09 Jun 2026 05:28:21 +0000 [thread overview]
Message-ID: <20260609052821.977BB1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609051759.405027-6-irogers@google.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Premature script abort and unreachable error handling logic due to the global `set -e` shell option in `test_disassembler`.
- [Low] The cleanup function unnecessarily attempts to delete temporary configuration files that the script never creates.
--
commit 4dda72bcf9505cc21e386908e19f007d3ab5a6ec
Author: Ian Rogers <irogers@google.com>
perf test: Enhance annotate test coverage and isolate config
This commit updates the annotate.sh shell test to cover different disassembler
backends utilizing the new command-line option. It also attempts to isolate
the test script from host environment pollution by exporting
PERF_CONFIG=/dev/null at the start of the script.
> diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh
> index 689de58e92384..d3bafa7e3db55 100755
> --- a/tools/perf/tests/shell/annotate.sh
> +++ b/tools/perf/tests/shell/annotate.sh
[ ... ]
> @@ -23,6 +25,7 @@ disasm_regex="[0-9]*\.[0-9]* *: *\w*: *\w*"
> cleanup() {
> rm -rf "${perfdata}" "${perfout}"
> rm -rf "${perfdata}".old
> + rm -f /tmp/__perf_test.config.*
>
> trap - EXIT TERM INT
> }
[Severity: Low]
Is this cleanup necessary?
Since PERF_CONFIG is exported to /dev/null at the start of the script, it
doesn't appear that any temporary configuration files matching this pattern
are ever created by this test.
[ ... ]
> @@ -106,8 +109,61 @@ test_basic() {
> +test_disassembler() {
> + disassembler=$1
> + feature=$2
[ ... ]
> + perf annotate --no-demangle -i "${perfdata}" --stdio --percent-limit 10 --disassembler "${disassembler}" 2> /dev/null > "${perfout}"
> + ret=$?
> +
> + if [ "x${ret}" != "x0" ]
> + then
> + echo "annotate with ${disassembler} [Failed: perf annotate error]"
> + err=1
> + return 1
> + fi
[Severity: Medium]
Because this script operates with set -e globally, will a failure of perf
annotate immediately abort the script?
If the command fails, it seems the shell would terminate before reaching the
ret=$? assignment, making the explicit error handling and logging dead code.
> +
> + # check if it has the target symbol
> + if ! grep -q "${testsym}" "${perfout}"
> + then
> + echo "annotate with ${disassembler} [Failed: missing target symbol]"
> + err=1
> + return 1
> + fi
[Severity: Medium]
Similarly, since the test_disassembler function is called sequentially
without protection, will returning 1 here trigger a set -e abort at the call
site?
This might abruptly halt the entire test suite and prevent the remaining
disassembler backends from running, rather than continuing to the next test
as the err=1 assignment suggests.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609051759.405027-1-irogers@google.com?part=5
next prev parent reply other threads:[~2026-06-09 5:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 5:17 [PATCH v1 0/7] perf annotate: Add elfutils libasm disassembler backend Ian Rogers
2026-06-09 5:17 ` [PATCH v1 1/7] tools build: Add feature check for elfutils libasm Ian Rogers
2026-06-09 5:28 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 2/7] perf build: Add build support and capability " Ian Rogers
2026-06-09 5:28 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 3/7] perf annotate: Implement elfutils libasm disassembler backend Ian Rogers
2026-06-09 5:30 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 4/7] perf annotate: Add --disassembler command-line option Ian Rogers
2026-06-09 5:17 ` [PATCH v1 5/7] perf test: Enhance annotate test coverage and isolate config Ian Rogers
2026-06-09 5:28 ` sashiko-bot [this message]
2026-06-09 5:17 ` [PATCH v1 6/7] perf annotate: Support BPF JIT disassembly via genelf Ian Rogers
2026-06-09 5:33 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 7/7] perf test: Add BPF JIT annotation test coverage for all disassemblers Ian Rogers
2026-06-09 5:36 ` sashiko-bot
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=20260609052821.977BB1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=irogers@google.com \
--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