mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Tim Bird <tim.bird@am.sony.com>
Cc: "Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	"Frederic Weisbecker" <fweisbec@gmail.com>,
	"Abhishek Sagar" <sagar.abhishek@gmail.com>,
	linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>,
	"linux kernel" <linux-kernel@vger.kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: Anyone working on ftrace function graph support on ARM?
Date: Fri, 27 Mar 2009 12:58:08 +0000	[thread overview]
Message-ID: <1238158688.9698.16.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <49CA5CFF.8090908@am.sony.com>

On Wed, 2009-03-25 at 09:34 -0700, Tim Bird wrote:
> Russell King - ARM Linux wrote:
> > As pointed out in my previous mail, identifying where on the stack the
> > return address is stored is only possible for OABI with frame pointers.
> > 
> > EABI will probably be possible with the stack unwinding code, but it
> > probably won't be cheap.  The EABI unwinder is scheduled for merging
> > during the present now-open merge window.
> 
> -finstrument-functions is looking better and better.  I know it
> adds more overhead than the mcount call, and may wreak havoc with
> the dynamic ftrace mechanisms, but at least the callouts are
> simple, clear, and you get both entry and exit, at fixed
> costs.  

This approach would work even with Thumb-2 compiled kernels (not in
mainline) where the frame pointer is useless wrt backtraces. The Thumb-2
kernel cannot currently be compiled with frame pointer because there is
some inline assembly where gcc fail to allocate lower registers (in
Thumb, the frame pointer is r7).

Anyway, the EABI toolchain I have (from CodeSourcery) generates
something like below with -pg for both ARM and Thumb code (so that it
doesn't rely on the frame pointer):

	push	{lr}
	bl	__gnu_mcount_nc

I think this will be (was?) merged into the mainline gcc for ARM. The
-pg option is still incompatible with -fomit-frame-pointer but maybe it
shouldn't be anymore.

> I'll take a look at the EABI unwinder to see
> what kind of variability it introduces (e.g. if it does a stack
> scan or something).

It's not cheap - it looks up the function address in a binary tree and
it reads some bytecodes (either from the tree or from a different table
pointed to by the tree) which it interprets to perform the equivalent of
a return from the current function (reading registers from the stack and
changing SP, LR).

-- 
Catalin


  parent reply	other threads:[~2009-03-27 12:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 19:38 Tim Bird
2009-03-24 20:25 ` Ingo Molnar
2009-03-24 20:48   ` Tim Bird
2009-03-24 20:38 ` Uwe Kleine-König
2009-03-24 21:36 ` Frederic Weisbecker
2009-03-24 21:40   ` Tim Bird
2009-03-24 21:48   ` Ingo Molnar
2009-03-24 21:57     ` Frederic Weisbecker
2009-03-24 22:14       ` Ingo Molnar
2009-03-24 22:54         ` Frederic Weisbecker
2009-03-25  8:36         ` Russell King - ARM Linux
2009-03-25 16:00       ` Steven Rostedt
2009-03-25 17:13         ` Frederic Weisbecker
2009-03-25 20:27         ` [PATCH][GIT PULL] x86, function-graph: only save return values on x86_64 Steven Rostedt
2009-03-25 20:45           ` Jaswinder Singh Rajput
2009-03-25 21:26             ` Steven Rostedt
2009-04-08 16:09           ` Ingo Molnar
2009-04-08 16:37             ` Steven Rostedt
2009-04-08 16:41               ` Ingo Molnar
2009-04-08 17:40             ` Frederic Weisbecker
2009-03-24 22:29   ` Anyone working on ftrace function graph support on ARM? Abhishek Sagar
2009-03-24 22:48     ` Frederic Weisbecker
2009-03-25  8:42       ` Russell King - ARM Linux
2009-03-25  8:54         ` Ingo Molnar
2009-03-25  9:57           ` Russell King - ARM Linux
2009-03-25 10:45             ` Uwe Kleine-König
2009-03-25 11:21               ` Russell King - ARM Linux
2009-03-25 12:09                 ` Uwe Kleine-König
2009-03-25 16:41           ` Tim Bird
2009-03-25 11:41         ` Frederic Weisbecker
2009-03-25 16:34         ` Tim Bird
2009-03-25 17:05           ` Uwe Kleine-König
2009-03-25 17:17             ` Russell King - ARM Linux
2009-03-25 18:37               ` Tim Bird
2009-03-25 18:41                 ` Steven Rostedt
2009-03-27 12:58           ` Catalin Marinas [this message]
2009-04-09 15:29             ` Daniel Jacobowitz

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=1238158688.9698.16.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sagar.abhishek@gmail.com \
    --cc=tim.bird@am.sony.com \
    --cc=u.kleine-koenig@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®