From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Tim Bird <tim.bird@am.sony.com>
Cc: linux kernel <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>,
Russell King <rmk@arm.linux.org.uk>,
Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH] Add function graph tracer support for ARM
Date: Fri, 24 Apr 2009 08:44:00 +0200 [thread overview]
Message-ID: <20090424064400.GB9502@pengutronix.de> (raw)
In-Reply-To: <49F0E284.2080104@am.sony.com>
Hello,
On Thu, Apr 23, 2009 at 02:49:56PM -0700, Tim Bird wrote:
> >> @@ -23,6 +23,7 @@ obj-$(CONFIG_ISA_DMA) += dma-isa.o
> >> obj-$(CONFIG_PCI) += bios32.o isa.o
> >> obj-$(CONFIG_SMP) += smp.o
> >> obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
> >> +obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
> > I there a reason that CONFIG_DYNAMIC_FTRACE and
> > CONFIG_FUNCTION_GRAPH_TRACER share the same source file?
> ftrace.c has stuff from both, so you want it "turned on"
> if one or the other (or both) are configed on.
I got this ...
>
> I'll look at whether it makes sense to split these two into
> separate files. This issue may be resolved by the code
> movement that Frederic Weisbecker mentioned in his e-mail.
... and this was my intention.
> >> --- a/arch/arm/kernel/entry-common.S
> >> +++ b/arch/arm/kernel/entry-common.S
> >> @@ -135,8 +135,16 @@ ENTRY(mcount)
> >> adr r0, ftrace_stub
> >> cmp r0, r2
> >> bne trace
> >> +
> >> +#ifdef CONFIG_FUNCTION_GRAPH_TRACER
> >> + ldr r1, =ftrace_graph_return
> >> + ldr r2, [r1]
> >> + cmp r0, r2 @ if *ftrace_graph_return != ftrace_stub
> >> + bne ftrace_graph_caller
> >> +#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
> >> +
> >> ldr lr, [fp, #-4] @ restore lr
> >> - ldmia sp!, {r0-r3, pc}
> >> + ldmia sp!, {r0-r3, pc} @ return doing nothing
> > If ftrace_trace_function != ftrace_stub then ftrace_graph_caller isn't
> > called. Is this correct?
> My comment is possibly misleading here. The sense of the
> '!=' includes the 'n' portion of the 'bne' on the following line.
> So the logic is:
> if *ftrace_graph_return != ftrace stub, branch to ftrace_graph_caller
> or in other words
> if *ftrace_graph_return == ftrace_stub, return doing nothing
>
> Maybe I should just remove the comment and let the code
> speak for itself? (or maybe move the comment down one line?)
Yes, the comments are as good as the comments for ftrace_trace_function.
What I meant is that with your code using both ftrace_trace_function and
ftrace_graph_caller doesn't work, because if ftrace_trace_function !=
ftrace_stub then the check for ftrace_trace_function is simply skipped.
And I just noticed something else: There is a 2nd implementation of
mcount in arch/arm/kernel/entry-common.S for CONFIG_DYNAMIC_FTRACE
(which is currently not selectable for ARM). Maybe add a note to this
mcount that it needs fixing for graph tracing when it is revived?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2009-04-24 6:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-23 18:08 [PATCH] Add function graph tracer support for ARM Tim Bird
2009-04-23 18:39 ` Uwe Kleine-König
2009-04-23 21:49 ` Tim Bird
2009-04-23 22:15 ` Frederic Weisbecker
2009-04-23 22:40 ` Tim Bird
2009-04-24 6:44 ` Uwe Kleine-König [this message]
2009-04-24 18:00 ` Tim Bird
2009-04-23 19:20 ` Frederic Weisbecker
2009-04-23 22:33 ` Tim Bird
2009-04-23 23:42 ` Frederic Weisbecker
2009-04-24 6:32 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090424064400.GB9502@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=fweisbec@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rmk@arm.linux.org.uk \
--cc=rostedt@goodmis.org \
--cc=tim.bird@am.sony.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox