mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix ftrace:function event recording
@ 2014-11-13 17:21 Jiri Olsa
  2014-11-13 17:25 ` Jiri Olsa
  2014-11-20  7:39 ` [tip:perf/core] perf evsel: " tip-bot for Jiri Olsa
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2014-11-13 17:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Corey Ashford, David Ahern,
	Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Steven Rostedt

Following patch fails (-EINVAL) ftrace:function with enabled user
space callchains:
  cfa77bc4af2c perf: Disallow user-space callchains for function trace events

We need to follow in perf tool itself and explicitly set the
perf_event_attr::exclude_callchain_user flag for ftrace:function
event.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/evsel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ec5eb8033296..a3baaa31231e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -658,6 +658,14 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
 		attr->mmap_data = track;
 	}
 
+	/*
+	 * We don't allow user space callchains for  function trace
+	 * event, due to issues with page faults while tracing page
+	 * fault handler and its overall trickiness nature.
+	 */
+	if (perf_evsel__is_function_event(evsel))
+		evsel->attr.exclude_callchain_user = 1;
+
 	if (callchain_param.enabled && !evsel->no_aux_samples)
 		perf_evsel__config_callgraph(evsel);
 
-- 
1.9.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Fix ftrace:function event recording
  2014-11-13 17:21 [PATCH] perf tools: Fix ftrace:function event recording Jiri Olsa
@ 2014-11-13 17:25 ` Jiri Olsa
  2014-11-20  7:39 ` [tip:perf/core] perf evsel: " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2014-11-13 17:25 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Steven Rostedt

On Thu, Nov 13, 2014 at 06:21:03PM +0100, Jiri Olsa wrote:
> Following patch fails (-EINVAL) ftrace:function with enabled user
> space callchains:
>   cfa77bc4af2c perf: Disallow user-space callchains for function trace events
> 
> We need to follow in perf tool itself and explicitly set the
> perf_event_attr::exclude_callchain_user flag for ftrace:function
> event.

forgot:

Reported-by: Steven Rostedt <rostedt@goodmis.org>

thanks,
jirka

> 
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/util/evsel.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index ec5eb8033296..a3baaa31231e 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -658,6 +658,14 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
>  		attr->mmap_data = track;
>  	}
>  
> +	/*
> +	 * We don't allow user space callchains for  function trace
> +	 * event, due to issues with page faults while tracing page
> +	 * fault handler and its overall trickiness nature.
> +	 */
> +	if (perf_evsel__is_function_event(evsel))
> +		evsel->attr.exclude_callchain_user = 1;
> +
>  	if (callchain_param.enabled && !evsel->no_aux_samples)
>  		perf_evsel__config_callgraph(evsel);
>  
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf evsel: Fix ftrace:function event recording
  2014-11-13 17:21 [PATCH] perf tools: Fix ftrace:function event recording Jiri Olsa
  2014-11-13 17:25 ` Jiri Olsa
@ 2014-11-20  7:39 ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-11-20  7:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: paulus, cjashfor, jolsa, mingo, a.p.zijlstra, dsahern, acme,
	linux-kernel, namhyung, tglx, rostedt, hpa, fweisbec

Commit-ID:  f140373bc904d9541e3f8e985d3810864e34c735
Gitweb:     http://git.kernel.org/tip/f140373bc904d9541e3f8e985d3810864e34c735
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 13 Nov 2014 18:21:03 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 19 Nov 2014 12:33:48 -0300

perf evsel: Fix ftrace:function event recording

Following patch fails (-EINVAL) ftrace:function with enabled user
space callchains:
  cfa77bc4af2c perf: Disallow user-space callchains for function trace events

We need to follow in perf tool itself and explicitly set the
perf_event_attr::exclude_callchain_user flag for ftrace:function
event.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1415899263-24820-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 34344ff..f2dc91f 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -658,6 +658,14 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
 		attr->mmap_data = track;
 	}
 
+	/*
+	 * We don't allow user space callchains for  function trace
+	 * event, due to issues with page faults while tracing page
+	 * fault handler and its overall trickiness nature.
+	 */
+	if (perf_evsel__is_function_event(evsel))
+		evsel->attr.exclude_callchain_user = 1;
+
 	if (callchain_param.enabled && !evsel->no_aux_samples)
 		perf_evsel__config_callgraph(evsel);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-20  7:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-13 17:21 [PATCH] perf tools: Fix ftrace:function event recording Jiri Olsa
2014-11-13 17:25 ` Jiri Olsa
2014-11-20  7:39 ` [tip:perf/core] perf evsel: " tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome