diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-04-11 17:37:45 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-04-11 21:18:21 -0400 |
commit | 22c8a376b55f327f7a25a318e87ba9202ba284bf (patch) | |
tree | b9c6261ba072cabf1d471e4139954847d763f3b0 /tools | |
parent | e68ae9cf7d734e669bc0a981b4154f70d29b5059 (diff) |
perf evlist: Add (reset,set)_sample_bit methods
For fiddling with sample_type fields in all evsels in an evlist.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-dg6yavctt0hzl2tsgfb43qsr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evlist.c | 18 | ||||
-rw-r--r-- | tools/perf/util/evlist.h | 11 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 86a03836a83f..4c9f510ae18d 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -1192,6 +1192,24 @@ void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, | |||
1192 | perf_evlist__propagate_maps(evlist); | 1192 | perf_evlist__propagate_maps(evlist); |
1193 | } | 1193 | } |
1194 | 1194 | ||
1195 | void __perf_evlist__set_sample_bit(struct perf_evlist *evlist, | ||
1196 | enum perf_event_sample_format bit) | ||
1197 | { | ||
1198 | struct perf_evsel *evsel; | ||
1199 | |||
1200 | evlist__for_each(evlist, evsel) | ||
1201 | __perf_evsel__set_sample_bit(evsel, bit); | ||
1202 | } | ||
1203 | |||
1204 | void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist, | ||
1205 | enum perf_event_sample_format bit) | ||
1206 | { | ||
1207 | struct perf_evsel *evsel; | ||
1208 | |||
1209 | evlist__for_each(evlist, evsel) | ||
1210 | __perf_evsel__reset_sample_bit(evsel, bit); | ||
1211 | } | ||
1212 | |||
1195 | int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel) | 1213 | int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel) |
1196 | { | 1214 | { |
1197 | struct perf_evsel *evsel; | 1215 | struct perf_evsel *evsel; |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 8db9228663d6..da46423998e8 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -87,6 +87,17 @@ int perf_evlist__add_dummy(struct perf_evlist *evlist); | |||
87 | int perf_evlist__add_newtp(struct perf_evlist *evlist, | 87 | int perf_evlist__add_newtp(struct perf_evlist *evlist, |
88 | const char *sys, const char *name, void *handler); | 88 | const char *sys, const char *name, void *handler); |
89 | 89 | ||
90 | void __perf_evlist__set_sample_bit(struct perf_evlist *evlist, | ||
91 | enum perf_event_sample_format bit); | ||
92 | void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist, | ||
93 | enum perf_event_sample_format bit); | ||
94 | |||
95 | #define perf_evlist__set_sample_bit(evlist, bit) \ | ||
96 | __perf_evlist__set_sample_bit(evlist, PERF_SAMPLE_##bit) | ||
97 | |||
98 | #define perf_evlist__reset_sample_bit(evlist, bit) \ | ||
99 | __perf_evlist__reset_sample_bit(evlist, PERF_SAMPLE_##bit) | ||
100 | |||
90 | int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter); | 101 | int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter); |
91 | int perf_evlist__set_filter_pid(struct perf_evlist *evlist, pid_t pid); | 102 | int perf_evlist__set_filter_pid(struct perf_evlist *evlist, pid_t pid); |
92 | int perf_evlist__set_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids); | 103 | int perf_evlist__set_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids); |