]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf python: Fix thread check in pyrf_evsel__read
authorIan Rogers <irogers@google.com>
Thu, 10 Jul 2025 23:51:23 +0000 (16:51 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 11 Jul 2025 19:36:40 +0000 (12:36 -0700)
The CPU index is incorrectly checked rather than the thread index.

Fixes: 739621f65702 ("perf python: Add evsel read method")
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250710235126.1086011-11-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/python.c

index 0821205b1aaa7f32630846be41ec52ccea85b7ff..4a3c2b4dd79fba15479c274a029cb510612aaff0 100644 (file)
@@ -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;