summaryrefslogtreecommitdiffstats
path: root/tools/perf/lib/include
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-21 13:24:50 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-07-29 18:34:46 -0300
commit88761fa1f1e3fb2df86727ac99f88abf2ac7e00b (patch)
treed2f1c05fe87394f6047fdbf377462b6452827021 /tools/perf/lib/include
parent50a4e6fa450c4e5b688814a7ec8236d0de6e38bf (diff)
downloadlinux-88761fa1f1e3fb2df86727ac99f88abf2ac7e00b.tar.gz
linux-88761fa1f1e3fb2df86727ac99f88abf2ac7e00b.tar.bz2
linux-88761fa1f1e3fb2df86727ac99f88abf2ac7e00b.zip
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>
Diffstat (limited to 'tools/perf/lib/include')
-rw-r--r--tools/perf/lib/include/internal/evsel.h2
-rw-r--r--tools/perf/lib/include/perf/evsel.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/lib/include/internal/evsel.h b/tools/perf/lib/include/internal/evsel.h
index 3cb9a0f5f32e..878e2cf41ffc 100644
--- a/tools/perf/lib/include/internal/evsel.h
+++ b/tools/perf/lib/include/internal/evsel.h
@@ -21,5 +21,7 @@ struct perf_evsel {
};
int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
+void perf_evsel__close_fd(struct perf_evsel *evsel);
+void perf_evsel__free_fd(struct perf_evsel *evsel);
#endif /* __LIBPERF_INTERNAL_EVSEL_H */
diff --git a/tools/perf/lib/include/perf/evsel.h b/tools/perf/lib/include/perf/evsel.h
index e9fbaa8fb51a..aa5c48f822d2 100644
--- a/tools/perf/lib/include/perf/evsel.h
+++ b/tools/perf/lib/include/perf/evsel.h
@@ -15,5 +15,6 @@ LIBPERF_API struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr);
LIBPERF_API void perf_evsel__delete(struct perf_evsel *evsel);
LIBPERF_API int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus,
struct perf_thread_map *threads);
+LIBPERF_API void perf_evsel__close(struct perf_evsel *evsel);
#endif /* __LIBPERF_EVSEL_H */