[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-0a74c5b3d20d2a8693848b6ae4f1a97624f5b781@git.kernel.org>
Date: Thu, 31 Mar 2016 02:25:42 -0700
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jolsa@...hat.com, eranian@...gle.com, linux-kernel@...r.kernel.org,
hpa@...or.com, tglx@...utronix.de,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
torvalds@...ux-foundation.org, rostedt@...dmis.org,
peterz@...radead.org, acme@...hat.com, vincent.weaver@...ne.edu,
acme@...nel.org, namhyung@...nel.org, mingo@...nel.org
Subject: [tip:perf/core] ftrace/perf: Check sample types only for sampling
events
Commit-ID: 0a74c5b3d20d2a8693848b6ae4f1a97624f5b781
Gitweb: http://git.kernel.org/tip/0a74c5b3d20d2a8693848b6ae4f1a97624f5b781
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Wed, 16 Mar 2016 15:34:29 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 31 Mar 2016 10:30:45 +0200
ftrace/perf: Check sample types only for sampling events
Currently we check sample type for ftrace:function events
even if it's not created as a sampling event. That prevents
creating ftrace_function event in counting mode.
Make sure we check sample types only for sampling events.
Before:
$ sudo perf stat -e ftrace:function ls
...
Performance counter stats for 'ls':
<not supported> ftrace:function
0.001983662 seconds time elapsed
After:
$ sudo perf stat -e ftrace:function ls
...
Performance counter stats for 'ls':
44,498 ftrace:function
0.037534722 seconds time elapsed
Suggested-by: Namhyung Kim <namhyung@...nel.org>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Steven Rostedt <rostedt@...dmis.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Link: http://lkml.kernel.org/r/1458138873-1553-2-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/trace/trace_event_perf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 00df25f..e11108f 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -47,6 +47,9 @@ static int perf_trace_event_perm(struct trace_event_call *tp_event,
if (perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN))
return -EPERM;
+ if (!is_sampling_event(p_event))
+ return 0;
+
/*
* We don't allow user space callchains for function trace
* event, due to issues with page faults while tracing page
Powered by blists - more mailing lists