[PATCH v1 2/4] perf evsel: Missed close when probing hybrid core PMUs
From: Ian Rogers
Date: Fri Jun 13 2025 - 20:41:33 EST
Add missing close to avoid leaking perf events. In past perfs this
mattered little as the function was just used by perf list. As the
function is now used to detect hybrid PMUs leaking the perf event is
somewhat more painful.
Fixes: b41f1cec91c3 ("perf list: Skip unsupported events")
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/util/print-events.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c
index a786cbfb0ff5..83aaf7cda635 100644
--- a/tools/perf/util/print-events.c
+++ b/tools/perf/util/print-events.c
@@ -268,6 +268,7 @@ bool is_event_supported(u8 type, u64 config)
ret = evsel__open(evsel, NULL, tmap) >= 0;
}
+ evsel__close(evsel);
evsel__delete(evsel);
}
--
2.50.0.rc1.591.g9c95f17f64-goog