From: sashiko-bot@kernel.org
To: "Dapeng Mi" <dapeng1.mi@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [Patch v10 10/10] perf tests: Add SIMD registers sampling test
Date: Tue, 21 Jul 2026 07:48:09 +0000 [thread overview]
Message-ID: <20260721074809.E5E151F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721072707.3787848-11-dapeng1.mi@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The test validation logic for SIMD register sampling uses a loose grep pattern that can falsely report success if a sampled symbol contains the register class name.
--
--- Patch [10]: [Patch v10 10/10] perf tests: Add SIMD registers sampling test ---
commit 1c34ec145d62a684219e4898c8fe2a820402bef2
Author: Dapeng Mi <dapeng1.mi@linux.intel.com>
perf tests: Add SIMD registers sampling test
Validate that SIMD registers (XMM/YMM/ZMM on x86) can be sampled
correctly with hardware support.
> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
> index 3c17f68ceb929..4a8539a65fa86 100755
> --- a/tools/perf/tests/shell/record.sh
> +++ b/tools/perf/tests/shell/record.sh
[ ... ]
> @@ -252,6 +252,136 @@ test_egpr_register_capture() {
[ ... ]
> +validate_simd_sampling_mode() {
> + local regs_opt="$1"
> + local simd_classes="$2"
> + local script_field="$3"
> + local simd_class
> + local sample_output
> +
> + for simd_class in ${simd_classes}
> + do
> + if ! sample_output=$(perf record -o - "${regs_opt}=${simd_class}" \
> + -e br_inst_retired.near_call -c 1000 --per-thread ${testprog} 2> /dev/null \
> + | perf script -F ip,sym,"${script_field}" -i - 2> /dev/null)
> + then
> + echo "SIMD register capture test [Failed record ${regs_opt}=${simd_class}]"
> + return 1
> + fi
> +
> + if ! has_required_regs "${sample_output}" "${simd_class}"
[Severity: Medium]
Will this search pattern mistakenly match symbol names instead of the actual
register dump?
When perf script outputs symbol names alongside the registers, passing the
raw class name without delimiters to has_required_regs might falsely match
C library routines like __memcmp_sse4_1_xmm or __memcpy_avx_unaligned_erms_ymm.
Could this check be made more strict, perhaps by including delimiters to
ensure it only matches the register dump data and not the sampled symbol
names?
> + then
> + echo "SIMD register capture test [Failed missing ${simd_class} sampling data]"
> + return 1
> + fi
> + done
> +
> + return 0
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260721072707.3787848-1-dapeng1.mi@linux.intel.com?part=10
prev parent reply other threads:[~2026-07-21 7:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 7:26 [Patch v10 00/10] Perf tools: Support eGPRs/SSP/SIMD registers sampling Dapeng Mi
2026-07-21 7:26 ` [Patch v10 01/10] perf dwarf-regs: Fix DWARF register index bounds check Dapeng Mi
2026-07-21 7:26 ` [Patch v10 02/10] perf util: Add missed fields in _attr__fprintf() and __attr_swap() Dapeng Mi
2026-07-21 7:27 ` [Patch v10 03/10] tools headers: Sync x86 headers with kernel sources Dapeng Mi
2026-07-21 7:39 ` sashiko-bot
2026-07-21 7:27 ` [Patch v10 04/10] perf headers: Sync perf_event.h/perf_regs.h with the kernel headers Dapeng Mi
2026-07-21 7:47 ` sashiko-bot
2026-07-21 7:27 ` [Patch v10 05/10] perf regs: Support x86 eGPRs/SSP sampling Dapeng Mi
2026-07-21 7:52 ` sashiko-bot
2026-07-21 7:27 ` [Patch v10 06/10] perf regs: Support x86 SIMD registers sampling Dapeng Mi
2026-07-21 7:50 ` sashiko-bot
2026-07-21 7:27 ` [Patch v10 07/10] perf regs: Enable dumping of SIMD registers Dapeng Mi
2026-07-21 7:27 ` [Patch v10 08/10] perf dwarf-regs: Add SIMD/eGPRs support for x86 DWARF registers Dapeng Mi
2026-07-21 7:27 ` [Patch v10 09/10] perf tests: Add x86 eGPRs/SSP registers sampling test Dapeng Mi
2026-07-21 7:42 ` sashiko-bot
2026-07-21 7:27 ` [Patch v10 10/10] perf tests: Add SIMD " Dapeng Mi
2026-07-21 7:48 ` 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=20260721074809.E5E151F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dapeng1.mi@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