diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-07-21 07:24:27 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-29 17:34:44 -0400 |
commit | 52e22fb8af779e1a26b1cbde1db2f82f78b3ae68 (patch) | |
tree | 5ff5a28de0783c1ad24774e8515bdfdb54217572 /tools/perf/lib | |
parent | 9a5edde6d3a6fb26101406534f7a5d09a9fcd362 (diff) |
libperf: Add perf_evlist__remove() function
Adding perf_evlist__remove() function to remove a perf_evsel from
a perf_evlist struct.
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-41-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib')
-rw-r--r-- | tools/perf/lib/evlist.c | 6 | ||||
-rw-r--r-- | tools/perf/lib/include/perf/evlist.h | 2 | ||||
-rw-r--r-- | tools/perf/lib/libperf.map | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index e5f187fa4e57..023fe4b44131 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c | |||
@@ -14,3 +14,9 @@ void perf_evlist__add(struct perf_evlist *evlist, | |||
14 | { | 14 | { |
15 | list_add_tail(&evsel->node, &evlist->entries); | 15 | list_add_tail(&evsel->node, &evlist->entries); |
16 | } | 16 | } |
17 | |||
18 | void perf_evlist__remove(struct perf_evlist *evlist, | ||
19 | struct perf_evsel *evsel) | ||
20 | { | ||
21 | list_del_init(&evsel->node); | ||
22 | } | ||
diff --git a/tools/perf/lib/include/perf/evlist.h b/tools/perf/lib/include/perf/evlist.h index 6992568b14a0..e0c87995c6ff 100644 --- a/tools/perf/lib/include/perf/evlist.h +++ b/tools/perf/lib/include/perf/evlist.h | |||
@@ -10,5 +10,7 @@ struct perf_evsel; | |||
10 | LIBPERF_API void perf_evlist__init(struct perf_evlist *evlist); | 10 | LIBPERF_API void perf_evlist__init(struct perf_evlist *evlist); |
11 | LIBPERF_API void perf_evlist__add(struct perf_evlist *evlist, | 11 | LIBPERF_API void perf_evlist__add(struct perf_evlist *evlist, |
12 | struct perf_evsel *evsel); | 12 | struct perf_evsel *evsel); |
13 | LIBPERF_API void perf_evlist__remove(struct perf_evlist *evlist, | ||
14 | struct perf_evsel *evsel); | ||
13 | 15 | ||
14 | #endif /* __LIBPERF_EVLIST_H */ | 16 | #endif /* __LIBPERF_EVLIST_H */ |
diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map index 06ccf31eb24d..168339f89a2e 100644 --- a/tools/perf/lib/libperf.map +++ b/tools/perf/lib/libperf.map | |||
@@ -12,6 +12,7 @@ LIBPERF_0.0.1 { | |||
12 | perf_evsel__init; | 12 | perf_evsel__init; |
13 | perf_evlist__init; | 13 | perf_evlist__init; |
14 | perf_evlist__add; | 14 | perf_evlist__add; |
15 | perf_evlist__remove; | ||
15 | local: | 16 | local: |
16 | *; | 17 | *; |
17 | }; | 18 | }; |