diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2014-07-14 06:02:56 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-07-16 16:57:36 -0400 |
commit | 6ff1ce763921f605aaf98c7a828b7df24d6923dc (patch) | |
tree | 3b40b23fe75578081608688a291658b3f16c8440 /tools | |
parent | ea8e08a16a1e6566be3f775c0bd351fa52ab6b9d (diff) |
perf evsel: Add 'no_aux_samples' option
Add an option to prevent additional samples being added to a selected
event by perf_evsel__config().
This is needed when using the sched_switch tracepoint to follow object
code execution. Since sched_switch will be used only for switch
information, additional sampling is wasteful.
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/1405332185-4050-33-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 6 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index b760d32aae06..40626e5fc1c0 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -623,7 +623,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts) | |||
623 | attr->mmap_data = track; | 623 | attr->mmap_data = track; |
624 | } | 624 | } |
625 | 625 | ||
626 | if (opts->call_graph_enabled) | 626 | if (opts->call_graph_enabled && !evsel->no_aux_samples) |
627 | perf_evsel__config_callgraph(evsel, opts); | 627 | perf_evsel__config_callgraph(evsel, opts); |
628 | 628 | ||
629 | if (target__has_cpu(&opts->target)) | 629 | if (target__has_cpu(&opts->target)) |
@@ -637,7 +637,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts) | |||
637 | target__has_cpu(&opts->target) || per_cpu)) | 637 | target__has_cpu(&opts->target) || per_cpu)) |
638 | perf_evsel__set_sample_bit(evsel, TIME); | 638 | perf_evsel__set_sample_bit(evsel, TIME); |
639 | 639 | ||
640 | if (opts->raw_samples) { | 640 | if (opts->raw_samples && !evsel->no_aux_samples) { |
641 | perf_evsel__set_sample_bit(evsel, TIME); | 641 | perf_evsel__set_sample_bit(evsel, TIME); |
642 | perf_evsel__set_sample_bit(evsel, RAW); | 642 | perf_evsel__set_sample_bit(evsel, RAW); |
643 | perf_evsel__set_sample_bit(evsel, CPU); | 643 | perf_evsel__set_sample_bit(evsel, CPU); |
@@ -650,7 +650,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts) | |||
650 | attr->watermark = 0; | 650 | attr->watermark = 0; |
651 | attr->wakeup_events = 1; | 651 | attr->wakeup_events = 1; |
652 | } | 652 | } |
653 | if (opts->branch_stack) { | 653 | if (opts->branch_stack && !evsel->no_aux_samples) { |
654 | perf_evsel__set_sample_bit(evsel, BRANCH_STACK); | 654 | perf_evsel__set_sample_bit(evsel, BRANCH_STACK); |
655 | attr->branch_sample_type = opts->branch_stack; | 655 | attr->branch_sample_type = opts->branch_stack; |
656 | } | 656 | } |
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index a52e9a5bb2d0..8dfec05bcec2 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -83,6 +83,7 @@ struct perf_evsel { | |||
83 | int is_pos; | 83 | int is_pos; |
84 | bool supported; | 84 | bool supported; |
85 | bool needs_swap; | 85 | bool needs_swap; |
86 | bool no_aux_samples; | ||
86 | /* parse modifier helper */ | 87 | /* parse modifier helper */ |
87 | int exclude_GH; | 88 | int exclude_GH; |
88 | int nr_members; | 89 | int nr_members; |