All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Radford <radford@galvanix.net>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ftrace: mcount record based dynamic tracing for ARM
Date: Fri, 21 Nov 2008 15:38:27 +0000	[thread overview]
Message-ID: <20081121153827.GA8433@flint.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.DEB.1.10.0811210917380.6447@gandalf.stny.rr.com>

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.

  reply	other threads:[~2008-11-21 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081118231525.GA16081@blackbean.org>
     [not found] ` <alpine.DEB.1.10.0811201734050.14652@gandalf.stny.rr.com>
     [not found]   ` <20081120224903.GA3244@blackbean.org>
     [not found]     ` <alpine.DEB.1.10.0811202114560.4464@gandalf.stny.rr.com>
     [not found]       ` <20081121035509.GA5266@blackbean.org>
2008-11-21 14:27         ` [PATCH] ftrace: mcount record based dynamic tracing for ARM Steven Rostedt
2008-11-21 15:38           ` Russell King - ARM Linux [this message]
2008-11-21 16:37             ` Steven Rostedt
2008-11-21 18:09             ` Jim Radford

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=20081121153827.GA8433@flint.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=radford@galvanix.net \
    --cc=rostedt@goodmis.org \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.