summaryrefslogtreecommitdiff
path: root/tools/perf/python/treport.py
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-09-25 23:19:29 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-09-26 20:49:27 +0200
commit514ecdfd0073686e2a61681fe6f9e08870d9a89a (patch)
treeac8ec8a19a4350daf5d5bdd6efe406928920c883 /tools/perf/python/treport.py
parentc4925cc8b8b1647b3cf9a9d8e84ac4c9f1e962c5 (diff)
downloadlinux-next-514ecdfd0073686e2a61681fe6f9e08870d9a89a.tar.gz
linux-next-514ecdfd0073686e2a61681fe6f9e08870d9a89a.zip
perf python: Update callchain stubs and session thread lookup
Update pyrf_session__find_thread() in util/python.c to accept an optional tid parameter (defaulting to pid) and return None instead of raising TypeError when a thread is not found in the session machines. Update perf.pyi to match: - Set session.find_thread() signature to (pid: int, tid: int = -1) -> Optional[thread]. - Update callchain_node.symbol and callchain_node.dso to str (the C getters return "[unknown]" fallback strings rather than None) and add __iter__() to callchain. Also update treport.py to handle Optional[thread] returned by session.find_thread(). Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/python/treport.py')
-rwxr-xr-xtools/perf/python/treport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/python/treport.py b/tools/perf/python/treport.py
index 43542599a884..786b852f471c 100755
--- a/tools/perf/python/treport.py
+++ b/tools/perf/python/treport.py
@@ -92,7 +92,7 @@ class ProfileNode:
try:
assert session
thread = session.find_thread(sample.sample_tid)
- comm = thread.comm()
+ comm = (thread.comm() if thread else None) or f"unknown ({pid})"
except Exception:
comm = f"unknown ({pid})"