* [PATCH 2/2] perf: Fix ftrace builtin when kernel doesn't have function_graph [not found] <1509546824-46165-1-git-send-email-julien.thierry@arm.com> @ 2017-11-01 14:33 ` Julien Thierry 2017-11-01 16:44 ` Steven Rostedt 0 siblings, 1 reply; 3+ messages in thread From: Julien Thierry @ 2017-11-01 14:33 UTC (permalink / raw) To: linux-arm-kernel Cc: takahiro.akashi, rostedt, Julien Thierry, Will Deacon, Mark Rutland, Peter Zijlstra, Ingo Molnar, linux-kernel When linux is built without support for function graph tracer, the ftrace builtin of perf will fail when trying to reset max_graph_depth because the file does not exist. This prevents the use of function tracer from perf. Do not attempt to write this file when the tracer in use is not function_graph. Signed-off-by: Julien Thierry <julien.thierry@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: linux-kernel@vger.kernel.org --- tools/perf/builtin-ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 25a42ac..48120f2 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -130,7 +130,8 @@ static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) if (reset_tracing_cpu() < 0) return -1; - if (write_tracing_file("max_graph_depth", "0") < 0) + if (!strcmp(ftrace->tracer, "function_graph") && + write_tracing_file("max_graph_depth", "0") < 0) return -1; reset_tracing_filters(); -- 1.9.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] perf: Fix ftrace builtin when kernel doesn't have function_graph 2017-11-01 14:33 ` [PATCH 2/2] perf: Fix ftrace builtin when kernel doesn't have function_graph Julien Thierry @ 2017-11-01 16:44 ` Steven Rostedt 2017-11-01 16:58 ` Julien Thierry 0 siblings, 1 reply; 3+ messages in thread From: Steven Rostedt @ 2017-11-01 16:44 UTC (permalink / raw) To: Julien Thierry Cc: linux-arm-kernel, takahiro.akashi, Will Deacon, Mark Rutland, Peter Zijlstra, Ingo Molnar, linux-kernel On Wed, 1 Nov 2017 14:33:44 +0000 Julien Thierry <julien.thierry@arm.com> wrote: > When linux is built without support for function graph tracer, the ftrace > builtin of perf will fail when trying to reset max_graph_depth because the > file does not exist. This prevents the use of function tracer from perf. > > Do not attempt to write this file when the tracer in use is not > function_graph. > > Signed-off-by: Julien Thierry <julien.thierry@arm.com> > Cc: Will Deacon <will.deacon@arm.com> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: linux-kernel@vger.kernel.org > --- > tools/perf/builtin-ftrace.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index 25a42ac..48120f2 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -130,7 +130,8 @@ static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) > if (reset_tracing_cpu() < 0) > return -1; > > - if (write_tracing_file("max_graph_depth", "0") < 0) > + if (!strcmp(ftrace->tracer, "function_graph") && > + write_tracing_file("max_graph_depth", "0") < 0) Hmm, instead of doing this, could we just do a stat on the file first. As with trace-cmd, I like to reset files like this even when not enabling function_graph tracer. -- Steve > return -1; > > reset_tracing_filters(); > -- > 1.9.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] perf: Fix ftrace builtin when kernel doesn't have function_graph 2017-11-01 16:44 ` Steven Rostedt @ 2017-11-01 16:58 ` Julien Thierry 0 siblings, 0 replies; 3+ messages in thread From: Julien Thierry @ 2017-11-01 16:58 UTC (permalink / raw) To: Steven Rostedt Cc: linux-arm-kernel, takahiro.akashi, Will Deacon, Mark Rutland, Peter Zijlstra, Ingo Molnar, linux-kernel On 01/11/17 16:44, Steven Rostedt wrote: > On Wed, 1 Nov 2017 14:33:44 +0000 > Julien Thierry <julien.thierry@arm.com> wrote: > >> When linux is built without support for function graph tracer, the ftrace >> builtin of perf will fail when trying to reset max_graph_depth because the >> file does not exist. This prevents the use of function tracer from perf. >> >> Do not attempt to write this file when the tracer in use is not >> function_graph. >> >> Signed-off-by: Julien Thierry <julien.thierry@arm.com> >> Cc: Will Deacon <will.deacon@arm.com> >> Cc: Mark Rutland <mark.rutland@arm.com> >> Cc: Peter Zijlstra <peterz@infradead.org> >> Cc: Ingo Molnar <mingo@redhat.com> >> Cc: linux-kernel@vger.kernel.org >> --- >> tools/perf/builtin-ftrace.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c >> index 25a42ac..48120f2 100644 >> --- a/tools/perf/builtin-ftrace.c >> +++ b/tools/perf/builtin-ftrace.c >> @@ -130,7 +130,8 @@ static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) >> if (reset_tracing_cpu() < 0) >> return -1; >> >> - if (write_tracing_file("max_graph_depth", "0") < 0) >> + if (!strcmp(ftrace->tracer, "function_graph") && >> + write_tracing_file("max_graph_depth", "0") < 0) > > Hmm, instead of doing this, could we just do a stat on the file first. > As with trace-cmd, I like to reset files like this even when not > enabling function_graph tracer. > Sounds reasonable. I'll include that change in the next version of the patches. Thanks, -- Julien Thierry ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-01 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1509546824-46165-1-git-send-email-julien.thierry@arm.com>
2017-11-01 14:33 ` [PATCH 2/2] perf: Fix ftrace builtin when kernel doesn't have function_graph Julien Thierry
2017-11-01 16:44 ` Steven Rostedt
2017-11-01 16:58 ` Julien Thierry
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