libperf: Adopt simplified perf_evsel__close() function from tools/perf

Add perf_evsel__close() function to libperf while keeping a tools/perf
specific evsel__close() to free ids.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-64-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Jiri Olsa
2019-07-21 13:24:50 +02:00
committed by Arnaldo Carvalho de Melo
parent 50a4e6fa45
commit 88761fa1f1
10 changed files with 40 additions and 31 deletions

View File

@@ -2401,7 +2401,7 @@ static int trace__event_handler(struct trace *trace, struct evsel *evsel,
if (evsel->max_events != ULONG_MAX && ++evsel->nr_events_printed == evsel->max_events) {
evsel__disable(evsel);
perf_evsel__close(evsel);
evsel__close(evsel);
}
}
}