perf evsel: Add 'no_aux_samples' option
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 14 Jul 2014 10:02:56 +0000 (13:02 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 16 Jul 2014 20:57:36 +0000 (17:57 -0300)
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>
tools/perf/util/evsel.c
tools/perf/util/evsel.h

index b760d32aae06a778ae82a7d342f1bda2baf8767b..40626e5fc1c080c44c03a3bb76a5e975fe4479b2 100644 (file)
@@ -623,7 +623,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
                attr->mmap_data = track;
        }
 
-       if (opts->call_graph_enabled)
+       if (opts->call_graph_enabled && !evsel->no_aux_samples)
                perf_evsel__config_callgraph(evsel, opts);
 
        if (target__has_cpu(&opts->target))
@@ -637,7 +637,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
             target__has_cpu(&opts->target) || per_cpu))
                perf_evsel__set_sample_bit(evsel, TIME);
 
-       if (opts->raw_samples) {
+       if (opts->raw_samples && !evsel->no_aux_samples) {
                perf_evsel__set_sample_bit(evsel, TIME);
                perf_evsel__set_sample_bit(evsel, RAW);
                perf_evsel__set_sample_bit(evsel, CPU);
@@ -650,7 +650,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
                attr->watermark = 0;
                attr->wakeup_events = 1;
        }
-       if (opts->branch_stack) {
+       if (opts->branch_stack && !evsel->no_aux_samples) {
                perf_evsel__set_sample_bit(evsel, BRANCH_STACK);
                attr->branch_sample_type = opts->branch_stack;
        }
index a52e9a5bb2d0b56d0eeeb2401ff8a557fde629b4..8dfec05bcec2dcbd70794a19ccf6a7aaaa7d1a40 100644 (file)
@@ -83,6 +83,7 @@ struct perf_evsel {
        int                     is_pos;
        bool                    supported;
        bool                    needs_swap;
+       bool                    no_aux_samples;
        /* parse modifier helper */
        int                     exclude_GH;
        int                     nr_members;