Re: oprofile callgraph support missing for common cpus
From: Joakim Tjernlund <hidden>
Date: 2011-12-05 08:50:19
Benjamin Herrenschmidt [off-list ref] wrote on 2011/11/25 06:24:32:
On Fri, 2011-11-18 at 09:22 +0100, Joakim Tjernlund wrote:quoted
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,"",@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)"