perf intel-pt: Add support for PERF_RECORD_SWITCH
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 13 Aug 2015 09:40:57 +0000 (12:40 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 4 Sep 2015 15:01:05 +0000 (12:01 -0300)
commit86c2786994bd7c0d4b525bbfbe42ac540d0b8166
treed536022cb55f7d0d3d2d98e7b70ad39f84919dee
parent1b29ac59b1d692c06ec543a5f35e0d9ebb98e003
perf intel-pt: Add support for PERF_RECORD_SWITCH

Add support for selecting and processing PERF_RECORD_SWITCH events for
use by Intel PT.  If they are available, they will be used in preference
to sched_switch events.

This enables an unprivileged user to trace multi-threaded or
multi-process workloads with any level of perf_event_paranoid.  However
it depends on kernel support for PERF_RECORD_SWITCH.

Without this patch, tracing a multi-threaded workload will decode
without error but all the data will be attributed to the main thread.

Without this patch, tracing a multi-process workload will result in
decoder errors because the decoder will not know which executable is
executing.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1439458857-30636-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/x86/util/intel-pt.c
tools/perf/util/intel-pt.c