diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2014-07-31 02:00:52 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-08-13 18:21:32 -0400 |
commit | 60b0896cc35243f515eda2085f9897e296177e45 (patch) | |
tree | 21db1aaecc43f11e1c0465e3ffb917a2731b6e05 /tools/perf/util/evlist.c | |
parent | bf8e8f4b832972c76d64ab2e2837a48397144887 (diff) |
perf evlist: Add perf_evlist__set_tracking_event()
Add a function to change which event is used to track mmap, comm and
task events.
This is needed with Instruction Tracing because the Instruction Tracing
event must come first but cannot be used for tracking because it will be
disabled under some circumstances.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1406786474-9306-10-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index c74d8ecc9c70..9d863db3f4b2 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -122,6 +122,7 @@ void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry) | |||
122 | { | 122 | { |
123 | list_add_tail(&entry->node, &evlist->entries); | 123 | list_add_tail(&entry->node, &evlist->entries); |
124 | entry->idx = evlist->nr_entries; | 124 | entry->idx = evlist->nr_entries; |
125 | entry->tracking = !entry->idx; | ||
125 | 126 | ||
126 | if (!evlist->nr_entries++) | 127 | if (!evlist->nr_entries++) |
127 | perf_evlist__set_id_pos(evlist); | 128 | perf_evlist__set_id_pos(evlist); |
@@ -1295,3 +1296,19 @@ void perf_evlist__to_front(struct perf_evlist *evlist, | |||
1295 | 1296 | ||
1296 | list_splice(&move, &evlist->entries); | 1297 | list_splice(&move, &evlist->entries); |
1297 | } | 1298 | } |
1299 | |||
1300 | void perf_evlist__set_tracking_event(struct perf_evlist *evlist, | ||
1301 | struct perf_evsel *tracking_evsel) | ||
1302 | { | ||
1303 | struct perf_evsel *evsel; | ||
1304 | |||
1305 | if (tracking_evsel->tracking) | ||
1306 | return; | ||
1307 | |||
1308 | evlist__for_each(evlist, evsel) { | ||
1309 | if (evsel != tracking_evsel) | ||
1310 | evsel->tracking = false; | ||
1311 | } | ||
1312 | |||
1313 | tracking_evsel->tracking = true; | ||
1314 | } | ||