From: sashiko-bot@kernel.org
To: "James Clark" <james.clark@linaro.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 16/19] perf test cs-etm: Make disassembly test use kcore
Date: Wed, 03 Jun 2026 10:36:09 +0000 [thread overview]
Message-ID: <20260603103610.2E1221F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260603-james-cs-context-tracking-fix-v3-16-c392945d9ed5@linaro.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The arm-cs-trace-disasm.py script fails to use the explicitly provided kcore file for dynamically loaded kernel modules, silently falling back to the unpatched build-id ELF.
--
commit fb1d5bc3ba8d47081f18c5b9c0c07af6646b6389
Author: James Clark <james.clark@linaro.org>
perf test cs-etm: Make disassembly test use kcore
Hits in modules return empty disassembly with vmlinux as an input to objdump.
Make the disassembly test more reliable by always using kcore. And update the
comments to say that this is supported by the script.
> diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> index ba208c90d6311..8f6fa4a007b42 100755
> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> @@ -18,29 +18,29 @@ from perf_trace_context import perf_sample_srccode, perf_config_get
>
> # Below are some example commands for using this script.
> # Note a --kcore recording is required for accurate decode
> -# due to the alternatives patching mechanism. However this
> -# script only supports reading vmlinux for disassembly dump,
> -# meaning that any patched instructions will appear
> -# as unpatched, but the instruction ranges themselves will
> -# be correct. In addition to this, source line info comes
> -# from Perf, and when using kcore there is no debug info. The
> -# following lists the supported features in each mode:
> +# due to the alternatives patching mechanism. In addition to this,
> +# source line info comes from Perf, and when using kcore there is
> +# no debug info. The following lists the supported features in each mode:
> #
> # +-----------+-----------------+------------------+------------------+
> # | Recording | Accurate decode | Source line dump | Disassembly dump |
> # +-----------+-----------------+------------------+------------------+
> # | --kcore | yes | no | yes |
> -# | normal | no | yes | yes |
> +# | normal | no | yes (inaccurate) | yes (inaccurate) |
> # +-----------+-----------------+------------------+------------------+
[Severity: Medium]
While this commit advertises kcore support, does arm-cs-trace-disasm.py
actually use the kcore file for dynamically loaded kernel modules?
Looking at get_dso_file_path() in
tools/perf/scripts/python/arm-cs-trace-disasm.py, if a module (e.g., [ext4])
is encountered, it bypasses options.vmlinux completely and attempts to use
the unpatched ELF from the build-id directory:
if (dso_name == "[kernel.kallsyms]" or dso_name == "vmlinux"):
if (options.vmlinux):
return options.vmlinux;
else:
return find_vmlinux() if find_vmlinux() else dso_name
if (dso_name == "[vdso]") :
append = "/vdso"
else:
append = "/elf"
dso_path = os.environ['PERF_BUILDID_DIR'] + "/" + dso_name + "/" + dso_build_id + append;
Additionally, if get_dso_file_path() were changed to return the kcore file
for modules, would process_event() still fail?
process_event() sets dso_vm_start to the module's map start address:
if (dso == "[kernel.kallsyms]" or dso_start == 0x400000):
dso_vm_start = 0
map_pgoff = 0
else:
dso_vm_start = int(dso_start)
The subsequent read_disam() call then subtracts this from the sample address
to pass relative file offsets to objdump. This works for module ELFs but
breaks kcore, which requires absolute virtual addresses.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260603-james-cs-context-tracking-fix-v3-0-c392945d9ed5@linaro.org?part=16
next prev parent reply other threads:[~2026-06-03 10:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 10:17 [PATCH v3 00/19] perf cs-etm: Queue context packets for frontend James Clark
2026-06-03 10:17 ` [PATCH v3 01/19] " James Clark
2026-06-03 10:32 ` sashiko-bot
2026-06-03 20:14 ` Amir Ayupov
2026-06-03 10:17 ` [PATCH v3 02/19] perf test: Add workload-ctl option James Clark
2026-06-03 10:17 ` [PATCH v3 03/19] perf test: Add a workload that forces context switches James Clark
2026-06-03 10:28 ` sashiko-bot
2026-06-03 10:17 ` [PATCH v3 04/19] perf test cs-etm: Test process attribution James Clark
2026-06-03 10:17 ` [PATCH v3 05/19] perf test: Add deterministic workload James Clark
2026-06-03 10:24 ` sashiko-bot
2026-06-03 10:17 ` [PATCH v3 06/19] perf test cs-etm: Replace unroll loop thread with deterministic decode test James Clark
2026-06-03 10:30 ` sashiko-bot
2026-06-03 10:17 ` [PATCH v3 07/19] perf test cs-etm: Remove asm_pure_loop test James Clark
2026-06-03 10:17 ` [PATCH v3 08/19] perf test cs-etm: Replace memcpy test with raw dump stress test James Clark
2026-06-03 10:17 ` [PATCH v3 09/19] perf test: Add named_threads workload James Clark
2026-06-03 10:26 ` sashiko-bot
2026-06-03 10:17 ` [PATCH v3 10/19] perf test cs-etm: Test decoding for concurrent threads test James Clark
2026-06-03 10:17 ` [PATCH v3 11/19] perf test cs-etm: Remove duplicate branch tests James Clark
2026-06-03 10:17 ` [PATCH v3 12/19] perf test cs-etm: Skip if not root James Clark
2026-06-03 10:17 ` [PATCH v3 13/19] perf test cs-etm: Reduce snapshot size James Clark
2026-06-03 10:17 ` [PATCH v3 14/19] perf test cs-etm: Speed up basic test James Clark
2026-06-03 10:17 ` [PATCH v3 15/19] perf test cs-etm: Remove unused Coresight workloads James Clark
2026-06-03 10:41 ` sashiko-bot
2026-06-03 10:17 ` [PATCH v3 16/19] perf test cs-etm: Make disassembly test use kcore James Clark
2026-06-03 10:36 ` sashiko-bot [this message]
2026-06-03 10:17 ` [PATCH v3 17/19] perf test cs-etm: Add all branch instructions to test James Clark
2026-06-03 10:17 ` [PATCH v3 18/19] perf test cs-etm: Speed up disassembly test James Clark
2026-06-03 10:17 ` [PATCH v3 19/19] perf test cs-etm: Move existing tests to coresight folder 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=20260603103610.2E1221F00893@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