From: sashiko-bot@kernel.org
To: "Andi Kleen" <ak@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v4 4/4] perf tools: Add test for weight annotation
Date: Tue, 18 Aug 2026 23:10:03 +0000 [thread overview]
Message-ID: <20260818231004.2B9191F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818230229.1491871-5-ak@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Silent failures on intermediate commands cause test logs to be deleted without error output.
--
--- Patch [4]: [PATCH v4 4/4] perf tools: Add test for weight annotation ---
commit fa7661757e0ece36caeb06128442cf38d097b4dd
Author: Andi Kleen <ak@linux.intel.com>
perf tools: Add test for weight annotation
This commit adds a shell script test case to verify if the --stdio weight
annotation functions correctly.
> 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
[ ... ]
> +if ! awk '$1 ~ /^[0-9]/ && ($1 + 0) > 0 { found = 1 } END { exit !found }' \
> + "${report_out}"; then
> + 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]
Because the script runs under set -e, will a failure in perf annotate or
grep cause the script to exit immediately and trigger the cleanup trap?
If the script aborts here, it appears it will delete the log files without
printing any error output, which might mask the failure reason and make
debugging difficult.
> +
> +# The second numeric column is the rendered average weight. This assertion
> +# fails on the original regression because calc_percent() left it at zero.
> +if ! awk '$1 ~ /^[0-9]/ && $2 ~ /^[0-9]/ && ($2 + 0) > 0 { found = 1 } END { exit !found }' \
> + "${annotate_out}"; then
> + echo "Annotation output contained no nonzero weight"
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818230229.1491871-1-ak@linux.intel.com?part=4
prev parent reply other threads:[~2026-08-18 23:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 23:01 v4 of perf weight annotation Andi Kleen
2026-08-18 23:01 ` [PATCH v4 1/4] perf tools record: Modernize -W man page Andi Kleen
2026-08-18 23:05 ` sashiko-bot
2026-08-18 23:01 ` [PATCH v4 2/4] perf tools top: Add --weight option Andi Kleen
2026-08-18 23:09 ` sashiko-bot
2026-08-18 23:01 ` [PATCH v4 3/4] perf tools: Add support for displaying weights in annotate Andi Kleen
2026-08-18 23:15 ` sashiko-bot
2026-08-18 23:01 ` [PATCH v4 4/4] perf tools: Add test for weight annotation Andi Kleen
2026-08-18 23:10 ` 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=20260818231004.2B9191F000E9@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox