diff options
| author | James Clark <james.clark@linaro.org> | 2026-09-28 13:58:09 +0100 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-09-28 18:30:01 +0200 |
| commit | da39380560de588b5e16efc334f62ecc6dd9af40 (patch) | |
| tree | a21d5a3279f3ad2a2016ac803d1fdf6be4371e8d /tools/perf/python | |
| parent | 5479e1a13b7592c5010b95b11a1167989dfd6bf1 (diff) | |
| download | linux-next-da39380560de588b5e16efc334f62ecc6dd9af40.tar.gz linux-next-da39380560de588b5e16efc334f62ecc6dd9af40.zip | |
perf python: Fix arm-cs-trace-disasm type error
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>
Diffstat (limited to 'tools/perf/python')
| -rwxr-xr-x | tools/perf/python/arm-cs-trace-disasm.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/python/arm-cs-trace-disasm.py b/tools/perf/python/arm-cs-trace-disasm.py index cf126ac79c18..1812ccaf4b20 100755 --- a/tools/perf/python/arm-cs-trace-disasm.py +++ b/tools/perf/python/arm-cs-trace-disasm.py @@ -263,9 +263,7 @@ class TraceDisasm: dso = getattr(sample, 'dso_long_name', None) or sample.dso or '[unknown]' symbol = sample.symbol or '[unknown]' - dso_bid = (sample.dso_bid.decode('utf-8') - if isinstance(sample.dso_bid, bytes) - else str(sample.dso_bid or '[unknown]')) + dso_bid = sample.dso_bid or '[unknown]' dso_start = sample.map_start dso_end = sample.map_end map_pgoff = sample.map_pgoff or 0 |
