diff options
author | Adrian Hunter | 2017-05-26 11:17:38 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2017-06-30 11:50:55 -0300 |
commit | 644e0840ad4615e032d67adec6ee60f821b669fe (patch) | |
tree | 88db8b2f914c735ac90fdafab4f4904689dbf4da /tools/perf/util/auxtrace.c | |
parent | 38b65b0891dc129dc0a5ce148a21c481e667b395 (diff) |
perf auxtrace: Add CPU filter support
Decoding auxtrace data can take a long time. To avoid decoding
unnecessarily, filter auxtrace data that is collected per-cpu before it is
decoded.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1495786658-18063-38-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/auxtrace.c')
-rw-r--r-- | tools/perf/util/auxtrace.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 651c01dfa5d3..5547457566a7 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -322,6 +322,13 @@ static int auxtrace_queues__add_event_buffer(struct auxtrace_queues *queues, return auxtrace_queues__add_buffer(queues, idx, buffer); } +static bool filter_cpu(struct perf_session *session, int cpu) +{ + unsigned long *cpu_bitmap = session->itrace_synth_opts->cpu_bitmap; + + return cpu_bitmap && cpu != -1 && !test_bit(cpu, cpu_bitmap); +} + int auxtrace_queues__add_event(struct auxtrace_queues *queues, struct perf_session *session, union perf_event *event, off_t data_offset, @@ -331,6 +338,9 @@ int auxtrace_queues__add_event(struct auxtrace_queues *queues, unsigned int idx; int err; + if (filter_cpu(session, event->auxtrace.cpu)) + return 0; + buffer = zalloc(sizeof(struct auxtrace_buffer)); if (!buffer) return -ENOMEM; |