aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/lib/include
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2019-07-21 13:24:49 +0200
committerArnaldo Carvalho de Melo <[email protected]>2019-07-29 18:34:46 -0300
commit50a4e6fa450c4e5b688814a7ec8236d0de6e38bf (patch)
tree8fe6a61bb600c84746054d25f66b4b90b6178f70 /tools/perf/lib/include
parentb8eca4d761c57fcf691a8063cd562f205645d11f (diff)
libperf: Adopt simplified perf_evsel__open() function from tools/perf
Add a perf_evsel__open() function to libperf. It's a simplified version of evsel__open() without the fallback mechanism. We can try to merge it in the future to libperf, but it has many details, lets start simple, requiring the latest kernel, perf should continue using its evsel__open() version, continuing to support running on older kernels when possible. Signed-off-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexey Budankov <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/lib/include')
-rw-r--r--tools/perf/lib/include/perf/evsel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/lib/include/perf/evsel.h b/tools/perf/lib/include/perf/evsel.h
index a57efc0f5c8b..e9fbaa8fb51a 100644
--- a/tools/perf/lib/include/perf/evsel.h
+++ b/tools/perf/lib/include/perf/evsel.h
@@ -6,10 +6,14 @@
struct perf_evsel;
struct perf_event_attr;
+struct perf_cpu_map;
+struct perf_thread_map;
LIBPERF_API void perf_evsel__init(struct perf_evsel *evsel,
struct perf_event_attr *attr);
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);
#endif /* __LIBPERF_EVSEL_H */