aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/python.c
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2025-07-10 23:51:23 +0000
committerNamhyung Kim <[email protected]>2025-07-11 19:36:40 +0000
commit64ec9b997f3a9462901a404ad60f452f76dd2d6e (patch)
treeebf5aaab6b6738e25debefdf1158bbac803c8587 /tools/perf/util/python.c
parentperf python: In str(evsel) use the evsel__pmu_name helper (diff)
downloadkernel-64ec9b997f3a9462901a404ad60f452f76dd2d6e.tar.gz
kernel-64ec9b997f3a9462901a404ad60f452f76dd2d6e.zip
perf python: Fix thread check in pyrf_evsel__read
The CPU index is incorrectly checked rather than the thread index. Fixes: 739621f65702 ("perf python: Add evsel read method") Signed-off-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r--tools/perf/util/python.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 0821205b1aaa..4a3c2b4dd79f 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -910,7 +910,7 @@ static PyObject *pyrf_evsel__read(struct pyrf_evsel *pevsel,
return NULL;
}
thread_idx = perf_thread_map__idx(evsel->core.threads, thread);
- if (cpu_idx < 0) {
+ if (thread_idx < 0) {
PyErr_Format(PyExc_TypeError, "Thread %d is not part of evsel's threads",
thread);
return NULL;