linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: David Miller <davem@davemloft.net>
Cc: proski@gnu.org, a.p.zijlstra@chello.nl, sandmann@redhat.com,
	pq@iki.fi, linux-kernel@vger.kernel.org, rostedt@goodmis.org,
	linuxppc-dev@ozlabs.org, srostedt@redhat.com, paulus@samba.org,
	mingo@elte.hu
Subject: Re: [PATCH 2/2] ftrace: support for PowerPC
Date: Thu, 15 May 2008 11:48:02 -0500	[thread overview]
Message-ID: <20080515164802.GA2664@loki.buserror.net> (raw)
In-Reply-To: <20080514.222857.246967279.davem@davemloft.net>

On Wed, May 14, 2008 at 10:28:57PM -0700, David Miller wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> Date: Wed, 14 May 2008 23:49:44 -0400
> 
> > +#ifdef CONFIG_FTRACE
> > +#ifdef CONFIG_DYNAMIC_FTRACE
> > +_GLOBAL(mcount)
> > +_GLOBAL(_mcount)
> > +	stwu	r1,-48(r1)
> > +	stw	r3, 12(r1)
> > +	stw	r4, 16(r1)
> > +	stw	r5, 20(r1)
> > +	stw	r6, 24(r1)
> > +	mflr	r3
> > +	stw	r7, 28(r1)
> > +	mfcr	r5
> > +	stw	r8, 32(r1)
> > +	stw	r9, 36(r1)
> > +	stw	r10,40(r1)
> > +	stw	r3, 44(r1)
> > +	stw	r5, 8(r1)
> 
> Yikes, that's really expensive.
> 
> Can't you do a tail call and let the function you end
> up calling do all the callee-saved register pops onto
> the stack?

The PPC32 ABI seems to (unfortunately) suggest that, with mcount, all
registers are callee-saved (except for the modifiable-during-function-linkage
registers like r0, r11, and r12) -- so mcount has to save the registers that
the callee won't (because they're normally volatile).

-Scott

  parent reply	other threads:[~2008-05-15 16:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15  3:49 [PATCH 0/2] ftrace ported to PPC Steven Rostedt
2008-05-15  3:49 ` [PATCH 1/2] ftrace ppc: add irqs_disabled_flags to ppc Steven Rostedt
2008-05-16 12:05   ` Ingo Molnar
2008-05-15  3:49 ` [PATCH 2/2] ftrace: support for PowerPC Steven Rostedt
2008-05-15  5:28   ` David Miller
2008-05-15 13:38     ` Steven Rostedt
2008-05-15 16:48     ` Scott Wood [this message]
2008-05-16 12:06   ` Ingo Molnar
2008-05-20 14:04   ` Michael Ellerman
2008-05-20 14:17     ` Benjamin Herrenschmidt
2008-05-20 14:51       ` Steven Rostedt
2008-05-20 14:32     ` Steven Rostedt
2008-05-22 18:31     ` [PATCH] ftrace: powerpc clean ups Steven Rostedt
2008-05-27 15:36       ` Thomas Gleixner
2008-06-02  2:15       ` Michael Ellerman
2008-05-15  4:40 ` [PATCH 0/2] ftrace ported to PPC Paul Mackerras
2008-05-16 12:05   ` Ingo Molnar

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=20080515164802.GA2664@loki.buserror.net \
    --to=scottwood@freescale.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=pq@iki.fi \
    --cc=proski@gnu.org \
    --cc=rostedt@goodmis.org \
    --cc=sandmann@redhat.com \
    --cc=srostedt@redhat.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;
as well as URLs for NNTP newsgroup(s).