summaryrefslogtreecommitdiff
path: root/tools/perf/util/record.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2015-07-21 12:44:04 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-07-24 04:51:13 +0300
commitb757bb09134f479a087ece08d2cd2a6ba31c9210 (patch)
tree43c27fd49ea428f2e62c62c93040c7cdf3cc13fc /tools/perf/util/record.c
parent0286039f777ec0b6684868c34f7b16f97a069d6e (diff)
downloadlinux-b757bb09134f479a087ece08d2cd2a6ba31c9210.tar.xz
perf record: Add option --switch-events to select PERF_RECORD_SWITCH events
Add an option to select PERF_RECORD_SWITCH events. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Tested-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1437471846-26995-4-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/record.c')
-rw-r--r--tools/perf/util/record.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
index 1f7becbe5e18..0d228a29526d 100644
--- a/tools/perf/util/record.c
+++ b/tools/perf/util/record.c
@@ -85,6 +85,11 @@ static void perf_probe_comm_exec(struct perf_evsel *evsel)
evsel->attr.comm_exec = 1;
}
+static void perf_probe_context_switch(struct perf_evsel *evsel)
+{
+ evsel->attr.context_switch = 1;
+}
+
bool perf_can_sample_identifier(void)
{
return perf_probe_api(perf_probe_sample_identifier);
@@ -95,6 +100,11 @@ static bool perf_can_comm_exec(void)
return perf_probe_api(perf_probe_comm_exec);
}
+bool perf_can_record_switch_events(void)
+{
+ return perf_probe_api(perf_probe_context_switch);
+}
+
void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts)
{
struct perf_evsel *evsel;