Re: [PATCH] make CALLER_ADDRx overwriteable

Uwe Kleine-König
2009-02-26T13:45:57Z

Hi Steven,

On Thu, Feb 26, 2009 at 12:08:06AM -0500, Steven Rostedt wrote:
> On Wed, Feb 25, 2009 at 11:16:09PM +0100, Uwe Kleine-K??nig wrote:
> > The current definition of CALLER_ADDRx isn't suitable for all platforms.
> > E.g. for ARM __builtin_return_address(N) doesn't work for N > 0 and
> > AFAIK for powerpc there are no frame pointers needed to have a working
> > __builtin_return_address. This patch allows defining the CALLER_ADDRx
> > macros in <asm/ftrace.h> and let these take precedence.
> >
> > Signed-off-by: Uwe Kleine-K??nig <u.kleine-koenig@pengutronix.de>
>
> Ah, but unfortunately this will break other archs :-(
>
> They may not use FTRACE, but they do include the ftrace header (the
> ftrace.h header can be used for other types of tracing, not just
> function tracing).
Then that's from generic files, because the archs that don't have
<asm/ftrace.h> don't include <linus/ftrace.h> under arch/.

> A better solution would be to move the CALLER_ADDER0 out of the
> ftrace.h header completely. Not sure where though. Have a caller.h ?
> And then we can have ftrace.h include caller.h. A asm/caller.h can be
> used to override the default.
Well, but then every arch needs this file. I don't see an advantage
here. So I'd favour to add an empty ftrace.h for the relevant archs.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |