summaryrefslogtreecommitdiff
path: root/tools/perf/python/arm-cs-trace-disasm.py
AgeCommit message (Collapse)Author
12 daysperf python: Fix arm-cs-trace-disasm type errorJames Clark
The perf sample dso_bid getter returns a string or None, matching its Optional[str] annotation. Attempting to decode it as bytes causes mypy to report union-attr errors, even though this was behind a conditional that checked for bytes type. Use the string directly, retaining the fallback for an unknown build ID. This fixes the following build error: python/arm-cs-trace-disasm.py:266: error: Item "None" of "str | None" has no attribute "decode" [union-attr] Fixes: 279b402e5143214c ("perf python: Port arm-cs-trace-disasm to perf module") Reviewed-by: Leo Yan <leo.yan@arm.com> Reviewed-by: Ian Rogers <irogers@google.com> Assisted-by: Codex:GPT-6-Astra Signed-off-by: James Clark <james.clark@linaro.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
14 daysperf python: Port arm-cs-trace-disasm to perf moduleIan Rogers
Port arm-cs-trace-disasm.py to a standalone script in tools/perf/python/ using the perf module directly. Improvements compared to the legacy script: - Encapsulate trace disassembly state in a TraceDisasm class. - Default to itrace="b" when creating perf.session() (overridable via --itrace or PERF_ITRACE) so all CoreSight branch samples are synthesized without requiring --itrace=b on the command line. - Automatically search standard kernel debug paths (find_vmlinux()) when -k/--vmlinux is not specified, and query perf.config_get("annotate.objdump") for the default objdump binary. - Bound DISASM_CACHE memory consumption by evicting the cache at 1024 entries and skipping caching of oversized (> 512 lines) objdump outputs. - Use sample.srccode() from the perf extension module to annotate disassembly output with source filenames, line numbers, and source lines. Update the ARM CoreSight disassembly shell test (test_arm_coresight_disasm.sh) to invoke the standalone script. Assisted-by: Antigravity:gemini-3.1-pro Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>