Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Clark" <james.clark@linaro.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 14/14] perf cs-etm: Test multiple per-thread threads
Date: Fri, 21 Aug 2026 10:40:02 +0000	[thread overview]
Message-ID: <20260821104003.486061F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260821-james-cs-unformatted-per-thread-fix-v2-14-00c4fd0701b4@linaro.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The script will abort prematurely on non-TRBE systems due to `set -e` triggering on expected errors from `wait $perf` or `perf script`.
--

--- Patch [14]: [PATCH v2 14/14] perf cs-etm: Test multiple per-thread threads ---
commit 94423fa9c68e780595c834e59e6281ca36e48a32
Author: James Clark <james.clark@linaro.org>

perf cs-etm: Test multiple per-thread threads

This commit adds a test to verify that attaching to a process with multiple
child threads correctly records samples for all child threads using CoreSight.

> diff --git a/tools/perf/tests/shell/coresight/per-thread-multi.sh b/tools/perf/tests/shell/coresight/per-thread-multi.sh
> new file mode 100755
> index 0000000000000..ea525ed5e18bc
> --- /dev/null
> +++ b/tools/perf/tests/shell/coresight/per-thread-multi.sh
> @@ -0,0 +1,78 @@
> +#!/bin/bash -e

[ ... ]

> +kill $parent
> +wait $parent || true
> +unset parent
> +wait $perf

[Severity: Medium]
Will this script abort prematurely on non-TRBE systems?

As noted in the script's own comments, `perf record` is expected to fail
with `-EBUSY` on systems using shared sinks (non-TRBE) because two threads
try to use them simultaneously.

When this expected failure occurs, `perf record` exits with a non-zero
status. Because the script is running with `set -e` on the first line, the
unshielded `wait $perf` command will propagate this non-zero exit status,
causing the script to immediately abort.

This would prevent the script from reaching the intended TRBE skip logic
below. Could this be updated to `wait $perf || true` similar to the
`wait $parent || true` above?

> +unset perf
> +
> +echo "Decoding..."
> +perf script -i "$tmpdir/data" > "$tmpdir/script" 2>/dev/null

[Severity: Medium]
Similarly, will this unshielded `perf script` command also abort the script
under `set -e` if the `perf.data` file is missing or invalid due to the
preceding recording error?

> +
> +# Exit early unless there is a dedicated sink per core which only TRBE
> +# guarantees. This is because shared sinks will report BUSY if two threads try
> +# to use them at the same time
> +if ! ls /sys/bus/coresight/devices/trbe* > /dev/null 2>&1; then
> +	echo "No TRBE sinks, skipping output validation"
> +	exit 0
> +fi

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821-james-cs-unformatted-per-thread-fix-v2-0-00c4fd0701b4@linaro.org?part=14

      reply	other threads:[~2026-08-21 10:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  9:48 [PATCH v2 00/14] perf cs-etm: Per-thread mode fixes and snapshot wrap support James Clark
2026-08-21  9:48 ` [PATCH v2 01/14] perf cs-etm: Fix nVHE per-thread decoding James Clark
2026-08-21 10:00   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 02/14] perf cs-etm: Warn for invalid timestamp option James Clark
2026-08-21  9:56   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 03/14] perf cs-etm: Turn on context packet timestamps in per-thread mode James Clark
2026-08-21 10:01   ` sashiko-bot
2026-08-21 10:09     ` James Clark
2026-08-21  9:49 ` [PATCH v2 04/14] perf cs-etm: Use per-CPU queues for " James Clark
2026-08-21 10:04   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 05/14] perf cs-etm: Increase default timestamp generation period James Clark
2026-08-21  9:58   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 06/14] perf auxtrace: Turn Intel BTS snapshot search into a generic one James Clark
2026-08-21 10:00   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 07/14] perf arm-spe: Use generic snapshot search James Clark
2026-08-21  9:57   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 08/14] perf auxtrace: intel-pt: Use new snapshot_has_wrapped callback James Clark
2026-08-21 10:00   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 09/14] perf cs-etm: Queue partial AUX records James Clark
2026-08-21  9:56   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 10/14] perf cs-etm: Don't print missing buffers in snapshot mode James Clark
2026-08-21 10:01   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 11/14] perf auxtrace: cs-etm: Capture wrapped snapshots James Clark
2026-08-21 10:00   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 12/14] perf test: Allow infinite named_thread loops James Clark
2026-08-21 10:03   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 13/14] perf test: Add test for per-thread mode James Clark
2026-08-21 10:04   ` sashiko-bot
2026-08-21  9:49 ` [PATCH v2 14/14] perf cs-etm: Test multiple per-thread threads James Clark
2026-08-21 10:40   ` 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=20260821104003.486061F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=james.clark@linaro.org \
    --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