From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: Robert Richter <robert.richter@amd.com>,
linuxppc-dev@ozlabs.org, Andy Fleming <afleming@freescale.com>,
oprofile-list@lists.sourceforge.net
Subject: Re: oprofile callgraph support missing for common cpus
Date: Mon, 05 Dec 2011 20:01:26 +1100 [thread overview]
Message-ID: <1323075686.660.19.camel@pasglop> (raw)
In-Reply-To: <OFE1FEF3EC.6B76BECC-ONC125795D.002F3766-C125795D.00308AEE@transmode.se>
On Mon, 2011-12-05 at 09:50 +0100, Joakim Tjernlund wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 2011/11/25 06:24:32:
> >
> > On Fri, 2011-11-18 at 09:22 +0100, Joakim Tjernlund wrote:
> >
> > > I forgot to ask, oprofile mentions setting -no-omit-framepointer to get
> > > correct backtrace but I cannot turn on frame pointers for the ppc kernel.
> > > Isn't frame pointers needed for pcc? what about user space?
> >
> > PowerPC always has frame pointers, ignore that :-)
>
> A bit late but consider this:
.../...
Right I wasn't clear. We do have frame pointers for non-leaf functions,
and we can trace from LR when we are on a leaf function, we can use
__builtin_return_address as well.
We also explicitely prevent -fno-omit-frame-pointer, iirc, due to a bug
with older versions of gcc which could cause miscompiles under some
circumstances (though I don't remember the details).
Cheers,
Ben.
> int leaf(int x)
> {
> return x+3;
> }
>
> which yields(with gcc -O2 -S):
> .file "leaf.c"
> .section ".text"
> .align 2
> .globl leaf
> .type leaf, @function
> leaf:
> addi 3,3,3
> blr
> .size leaf, .-leaf
> .section .note.GNU-stack,"",@progbits
> .ident "GCC: (GNU) 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)"
>
>
> Here there is with frame pointer(I guess that the messing around with r11 and r31 is a defect?):
> (With gcc -O2 -S -fno-omit-frame-pointer)
>
> .file "leaf.c"
> .section ".text"
> .align 2
> .globl leaf
> .type leaf, @function
> leaf:
> stwu 1,-16(1)
> addi 3,3,3
> lwz 11,0(1)
> stw 31,12(1)
> mr 31,1
> lwz 31,-4(11)
> mr 1,11
> blr
> .size leaf, .-leaf
> .section .note.GNU-stack,"",@progbits
> .ident "GCC: (GNU) 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)"
prev parent reply other threads:[~2011-12-05 9:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 8:38 oprofile callgraph support missing for common cpus Joakim Tjernlund
2011-11-17 17:30 ` Maynard Johnson
2011-11-17 17:51 ` Andy Fleming
2011-11-17 21:27 ` Joakim Tjernlund
2011-11-17 23:20 ` Robert Richter
2011-11-18 8:09 ` Joakim Tjernlund
2011-11-18 8:22 ` Joakim Tjernlund
2011-11-25 5:24 ` Benjamin Herrenschmidt
2011-11-25 5:58 ` Juntang Fu(David)
2011-12-05 8:50 ` Joakim Tjernlund
2011-12-05 9:01 ` Benjamin Herrenschmidt [this message]
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=1323075686.660.19.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=afleming@freescale.com \
--cc=joakim.tjernlund@transmode.se \
--cc=linuxppc-dev@ozlabs.org \
--cc=oprofile-list@lists.sourceforge.net \
--cc=robert.richter@amd.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).