perf evsel: Force sample_type for slave events
authorJiri Olsa <jolsa@kernel.org>
Wed, 20 Feb 2019 12:27:56 +0000 (13:27 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 20 Feb 2019 19:08:59 +0000 (16:08 -0300)
Force sample_type setup for slave events in group leader sessions.

We don't get sample for slave events, we make them when delivering group
leader sample. Set the slave event to follow the master sample_type to
ease up report.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190220122800.864-3-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c

index 684c893..dfe2958 100644 (file)
@@ -956,6 +956,14 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
                attr->sample_freq    = 0;
                attr->sample_period  = 0;
                attr->write_backward = 0;
+
+               /*
+                * We don't get sample for slave events, we make them
+                * when delivering group leader sample. Set the slave
+                * event to follow the master sample_type to ease up
+                * report.
+                */
+               attr->sample_type = leader->attr.sample_type;
        }
 
        if (opts->no_samples)