All of lore.kernel.org
 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 v5 18/19] perf test cs-etm: Speed up disassembly test
Date: Tue, 09 Jun 2026 16:48:48 +0000	[thread overview]
Message-ID: <20260609164849.6CE6B1F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260609-james-cs-context-tracking-fix-v5-18-d53a7d096a19@linaro.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Reducing `--stop-sample` to 2 causes extreme test flakiness due to sample exhaustion and limited branch coverage.
--

commit ef4a0ff67bea24ddbc6e5c1bb7bfc2c172bd783d
Author: James Clark <james.clark@linaro.org>

perf test cs-etm: Speed up disassembly test

This commit limits the amount of trace to decode by using exit snapshots
and reduces the objdump sample limit from 30 to 2 to speed up the
disassembly test.

> diff --git a/tools/perf/tests/shell/test_arm_coresight_disasm.sh b/tools/perf/tests/shell/test_arm_coresight_disasm.sh
> index f78dfb6bf73e3..f2fb1aa92252a 100755
> --- a/tools/perf/tests/shell/test_arm_coresight_disasm.sh
> +++ b/tools/perf/tests/shell/test_arm_coresight_disasm.sh
> @@ -43,9 +43,9 @@ branch_search='[[:space:]](bl|b(\.(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)
>  ## Test kernel ##
>  if [ "$(id -u)" == 0 ] && [ -e /proc/kcore ]; then
>  	echo "Testing kernel disassembly"
> -	perf record -o ${perfdata} -e cs_etm//k --kcore -- touch $file > /dev/null 2>&1
> +	perf record -o ${perfdata} -e cs_etm//k --kcore -Se -m,64K -- touch $file > /dev/null 2>&1
>  	perf script -i ${perfdata} -s python:${script_path} -- \
> -		-d --stop-sample=30 -k ${perfdata}/kcore_dir/kcore 2> /dev/null > ${file}
> +		-d --stop-sample=2 -k ${perfdata}/kcore_dir/kcore 2> /dev/null > ${file}

[Severity: Medium]
Will this severe reduction in sample limit cause test flakiness?

Because sample index tracking in arm-cs-trace-disasm.py starts at -1,
setting the limit to 2 allows exactly 3 samples to be processed. The
script requires at least two branches events on the same CPU to invoke
objdump, since the first event only initializes the cpu data.

If a trace-on event or any instructions events are synthesized first,
they will consume the limited sample count without ever triggering objdump.
This could result in an empty disassembly output and a false negative
failure from grep.

Additionally, the branch regex lacks 32-bit return instructions like bx
or blx. Previously, larger sample sizes hid this gap. Processing only one
block might guarantee spurious failures on 32-bit systems if the block
ends in an unlisted branch.

>  	grep -q -E ${branch_search} ${file}
>  	echo "Found kernel branches"
>  else

[ ... ]

> @@ -55,9 +55,9 @@ fi
>  
>  ## Test user ##
>  echo "Testing userspace disassembly"
> -perf record -o ${perfdata} -e cs_etm//u -- touch $file > /dev/null 2>&1
> +perf record -o ${perfdata} -e cs_etm//u -Se -m,64K -- touch $file > /dev/null 2>&1
>  perf script -i ${perfdata} -s python:${script_path} -- \
> -	-d --stop-sample=30 2> /dev/null > ${file}
> +	-d --stop-sample=2 2> /dev/null > ${file}

[Severity: Medium]
Are userspace disassembly tests similarly affected by this sample
exhaustion?

Like the kernel test above, reducing the limit to 2 might not process
enough events to trigger objdump if trace-on or instruction events are
encountered first.

>  grep -q -E ${branch_search} ${file}
>  echo "Found userspace branches"

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609-james-cs-context-tracking-fix-v5-0-d53a7d096a19@linaro.org?part=18

  reply	other threads:[~2026-06-09 16:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 14:40 [PATCH v5 00/19] perf cs-etm: Queue context packets for frontend James Clark
2026-06-09 14:40 ` [PATCH v5 01/19] " James Clark
2026-06-09 14:40 ` [PATCH v5 02/19] perf test: Add workload-ctl option James Clark
2026-06-09 14:40 ` [PATCH v5 03/19] perf test: Add a workload that forces context switches James Clark
2026-06-09 14:40 ` [PATCH v5 04/19] perf test cs-etm: Test process attribution James Clark
2026-06-09 14:40 ` [PATCH v5 05/19] perf test: Add deterministic workload James Clark
2026-06-09 14:40 ` [PATCH v5 06/19] perf test cs-etm: Replace unroll loop thread with deterministic decode test James Clark
2026-06-09 17:04   ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 07/19] perf test cs-etm: Remove asm_pure_loop test James Clark
2026-06-09 14:40 ` [PATCH v5 08/19] perf test cs-etm: Replace memcpy test with raw dump stress test James Clark
2026-06-09 17:16   ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 09/19] perf test: Add named_threads workload James Clark
2026-06-09 16:00   ` sashiko-bot
2026-06-09 14:40 ` [PATCH v5 10/19] perf test cs-etm: Test decoding for concurrent threads test James Clark
2026-06-09 17:18   ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 11/19] perf test cs-etm: Remove duplicate branch tests James Clark
2026-06-09 14:40 ` [PATCH v5 12/19] perf test cs-etm: Skip if not root James Clark
2026-06-09 16:13   ` sashiko-bot
2026-06-09 14:40 ` [PATCH v5 13/19] perf test cs-etm: Reduce snapshot size James Clark
2026-06-09 14:40 ` [PATCH v5 14/19] perf test cs-etm: Speed up basic test James Clark
2026-06-09 14:40 ` [PATCH v5 15/19] perf test cs-etm: Remove unused Coresight workloads James Clark
2026-06-09 17:22   ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 16/19] perf test cs-etm: Make disassembly test use kcore James Clark
2026-06-09 14:40 ` [PATCH v5 17/19] perf test cs-etm: Add all branch instructions to test James Clark
2026-06-09 14:40 ` [PATCH v5 18/19] perf test cs-etm: Speed up disassembly test James Clark
2026-06-09 16:48   ` sashiko-bot [this message]
2026-06-09 14:40 ` [PATCH v5 19/19] perf test cs-etm: Move existing tests to coresight folder James Clark
2026-06-10 20:14 ` [PATCH v5 00/19] perf cs-etm: Queue context packets for frontend Arnaldo Carvalho de Melo
2026-06-11  8:37   ` James Clark

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=20260609164849.6CE6B1F00898@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 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.