libperf evsel: Add missed puts and asserts
authorIan Rogers <irogers@google.com>
Tue, 17 Jun 2025 22:33:56 +0000 (15:33 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 24 Jun 2025 17:27:51 +0000 (10:27 -0700)
commitbe59dba332e1e8edd3e88d991ba0e4795ae2bcb2
tree600416de450b5b00d939a8fee95f1098449fc626
parenteda9e47fae276d2b7a2b6a826b38259e6481d879
libperf evsel: Add missed puts and asserts

A missed evsel__close before evsel__delete was the source of leaking
perf events due to a hybrid test. Add asserts in debug builds so that
this shouldn't happen in the future. Add puts missing on the cpu map
and thread maps.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250617223356.2752099-4-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/lib/perf/evsel.c