oprofile callgraph support missing for common cpus

Joakim Tjernlund joakim.tjernlund at transmode.se
Mon Dec 5 19:50:12 EST 2011


Benjamin Herrenschmidt <benh at 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:

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,"", at 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,"", at progbits
	.ident	"GCC: (GNU) 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)"



More information about the Linuxppc-dev mailing list