lkml.org 
[lkml]   [2008]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ftrace: mcount record based dynamic tracing for ARM
On Fri, Nov 21, 2008 at 09:27:17AM -0500, Steven Rostedt wrote:
> On Thu, 20 Nov 2008, Jim Radford wrote:
> > - select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
> > + select HAVE_FTRACE_MCOUNT_RECORD
> > + select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
>
> Russell mentioned something about the code not being compatible with
> Thumb2, is the above if statement enough?

I think I said (or should've said) "upcoming Thumb 2" - it's not yet in
the kernel but there's a patch series floating around for it. We've
started on merging some of the pre-requisits, and it will mean that
the instruction length is no longer constant. (It may be a 16bit or
32bit instruction.)

I suspect that ftrace won't be able to handle that, so it may have to
depend on !THUMB2_KERNEL for the time being.

> > diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
> > index 06269ea..06216af 100644
> > --- a/arch/arm/kernel/entry-common.S
> > +++ b/arch/arm/kernel/entry-common.S
> > @@ -104,14 +104,7 @@ ENDPROC(ret_from_fork)
> > #ifdef CONFIG_FUNCTION_TRACER
> > #ifdef CONFIG_DYNAMIC_FTRACE
> > ENTRY(mcount)
> > - stmdb sp!, {r0-r3, lr}
> > - mov r0, lr
> > - sub r0, r0, #MCOUNT_INSN_SIZE
> > -
> > - .globl mcount_call
> > -mcount_call:
> > - bl ftrace_stub
> > - ldmia sp!, {r0-r3, pc}
> > + mov pc, lr
>
> This looks OK. The new mcount stub for dynamic ftrace is a simple return.
> It has been a while since I've programmed ARM (7 years ago), but I'm
> assuming that loading the program counter with the link register is
> a simple return.

Yes, that's all that's required.


\
 
 \ /
  Last update: 2008-11-21 16:41    [W:0.035 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site