diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2015-09-25 15:15:53 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-09-28 22:15:31 +0200 |
commit | 4768230ad57d4e4fc6d36c44e98e0062c89b0dc0 (patch) | |
tree | ef9e1ab3339acb1a00ae0d20474adcc0892290e7 /tools/perf/util/evlist.c | |
parent | perf evlist: Add perf_evlist__id2evsel_strict() (diff) | |
download | linux-4768230ad57d4e4fc6d36c44e98e0062c89b0dc0.tar.xz linux-4768230ad57d4e4fc6d36c44e98e0062c89b0dc0.zip |
perf evlist: Add perf_evlist__remove()
Add a counterpart to perf_evlist__add() that does the opposite and
deletes the evsel.
This will be used by perf inject to remove unwanted evsels.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1443186956-18718-23-git-send-email-adrian.hunter@intel.com
[ Renamed it from perf_evlist__del() to perf_evlist__remove() and removed the perf_evsel__delete() call ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | tools/perf/util/evlist.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index e6760380d731..89546228b8ed 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -165,6 +165,13 @@ void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry) __perf_evlist__propagate_maps(evlist, entry); } +void perf_evlist__remove(struct perf_evlist *evlist, struct perf_evsel *evsel) +{ + evsel->evlist = NULL; + list_del_init(&evsel->node); + evlist->nr_entries -= 1; +} + void perf_evlist__splice_list_tail(struct perf_evlist *evlist, struct list_head *list) { |