perf cs-etm: Configure SWITCH_EVENTS in CPU-wide mode
authorMathieu Poirier <mathieu.poirier@linaro.org>
Fri, 24 May 2019 17:34:54 +0000 (11:34 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 10 Jun 2019 18:50:01 +0000 (15:50 -0300)
Ask the perf core to generate an event when processes are swapped in/out
of context.  That way proper action can be taken by the decoding code
when faced with such event.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20190524173508.29044-4-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/arm/util/cs-etm.c

index be1e4f20affaffd72e4b9a09700e9e51c9c2550c..cc7f1cd23b1419570ecbd0dda05f03b5cdfed607 100644 (file)
@@ -257,6 +257,9 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
        ptr->evlist = evlist;
        ptr->snapshot_mode = opts->auxtrace_snapshot_mode;
 
+       if (perf_can_record_switch_events())
+               opts->record_switch_events = true;
+
        evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type == cs_etm_pmu->type) {
                        if (cs_etm_evsel) {