diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-12-10 15:21:30 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-12-10 15:21:30 -0300 |
commit | 7a5a5ca5fe3df8636c96b49591c23baf7c415dd4 (patch) | |
tree | f5f4ceffa11abff1dc53c605991597a68360c52c /tools/perf/util/evsel.h | |
parent | a60d79535c21dca4e24d08abf8ab56e2f860af71 (diff) | |
download | talos-op-linux-7a5a5ca5fe3df8636c96b49591c23baf7c415dd4.tar.gz talos-op-linux-7a5a5ca5fe3df8636c96b49591c23baf7c415dd4.zip |
perf evsel: Introduce method to request IDs be used
When mmaping multiple events we need to find the right evsel that
matches an event in the ring buffer.
For that we need to set the PERF_FORMAT_ID bit in
perf_event_attr.read_format so that when we read the event fds we get
that id to then hash it and be able later to use perf_evlist__id2evsel
to find the right evsel.
We also need to set the PERF_SAMPLE_ID bit in
perf_event_attr.sample_type to ask for that id to be stashed in each
sample, so that we can demux it.
So add a perf_evsel__set_sample_id() method to do those two things in
one operation.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
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/n/tip-1z4xcmbud30lamklfe80oopu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.h')
-rw-r--r-- | tools/perf/util/evsel.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 739853969243..5c089775064f 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -129,6 +129,8 @@ void __perf_evsel__reset_sample_bit(struct perf_evsel *evsel, #define perf_evsel__reset_sample_bit(evsel, bit) \ __perf_evsel__reset_sample_bit(evsel, PERF_SAMPLE_##bit) +void perf_evsel__set_sample_id(struct perf_evsel *evsel); + int perf_evsel__set_filter(struct perf_evsel *evsel, int ncpus, int nthreads, const char *filter); |