From: sashiko-bot@kernel.org
To: "Andi Kleen" <ak@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 4/4] perf tools: Add test for weight annotation
Date: Sun, 30 Aug 2026 19:56:33 +0000 [thread overview]
Message-ID: <20260830195633.BAAC31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260830193459.2840519-5-ak@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The script conflates PEBS support checking with workload execution, masking workload failures as skipped tests.
- [Medium] Silent test failure due to unhandled `grep -q` execution under `set -e`.
--
commit 8db1611c3b92cee56576e6157914227faf90fc5a
Author: Andi Kleen <ak@linux.intel.com>
perf tools: Add test for weight annotation
This commit adds a shell script test case to check if the --stdio weight
annotation functions correctly in perf annotate.
> diff --git a/tools/perf/tests/shell/annotate_weight.sh b/tools/perf/tests/shell/annotate_weight.sh
> new file mode 100755
> index 0000000000000..6b8c105c048b5
> --- /dev/null
> +++ b/tools/perf/tests/shell/annotate_weight.sh
[ ... ]
> +trap 'cleanup; exit 1' TERM INT
> +trap cleanup EXIT
> +
> +# mem-loads:pu requests a precise user PEBS event whose sample weight should
> +# be populated by -W. Unsupported PEBS/weight PMUs are skipped below.
> +if ! perf record -W -e mem-loads:pu -o "${perfdata}" -- perf test -w thloop \
> + > /dev/null 2> "${record_log}"; then
> + echo "[SKIP] precise PEBS weight sampling is unavailable"
> + exit 2
> +fi
[Severity: Medium]
If the inner workload (perf test -w thloop) crashes or otherwise fails to
execute, does this conditional block improperly catch the failure and report
it as an unsupported hardware feature?
It looks like any non-zero exit status from the child process will result
in a skipped test, which might mask underlying environment or test suite bugs.
[ ... ]
> + echo "[SKIP] PEBS weight sampling produced no nonzero weights"
> + exit 2
> +fi
> +
> +perf annotate --stdio -i "${perfdata}" --symbol "${testsym}" \
> + > "${annotate_out}" 2> "${record_log}"
> +
> +grep -q 'Percent Weight' "${annotate_out}"
[Severity: Medium]
Since set -e is enabled at the top of the script, will this isolated grep
command cause an abrupt and silent exit if the 'Percent Weight' header is
missing from the annotation output?
If the string is missing, grep will exit with code 1, which might instantly
abort the script without printing diagnostic output, making regressions harder
to debug.
> +
> +# The second numeric column is the rendered average weight. This assertion
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260830193459.2840519-1-ak@linux.intel.com?part=4
next prev parent reply other threads:[~2026-08-30 19:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 19:34 v5 of the perf weight annotation patchkit Andi Kleen
2026-08-30 19:34 ` [PATCH v5 1/4] perf tools record: Modernize -W man page Andi Kleen
2026-08-30 19:37 ` sashiko-bot
2026-08-30 19:34 ` [PATCH v5 2/4] perf tools top: Add --weight option Andi Kleen
2026-08-30 19:43 ` sashiko-bot
2026-08-31 17:35 ` Andi Kleen
2026-08-30 19:34 ` [PATCH v5 3/4] perf tools: Add support for displaying weights in annotate Andi Kleen
2026-08-30 19:53 ` sashiko-bot
2026-08-30 19:34 ` [PATCH v5 4/4] perf tools: Add test for weight annotation Andi Kleen
2026-08-30 19:56 ` sashiko-bot [this message]
2026-08-31 18:32 ` Andi Kleen
2026-09-01 15:14 ` v5 of the perf weight annotation patchkit Namhyung Kim
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=20260830195633.BAAC31F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ak@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.