Reputation: 643
I'm trying to use perf to get information about stack backtraces in my system. I compile an application where main calls f, f calls g1, g1 calls g3, g3 calls g4, g4 calls g2. I expect my backtrases to be something like
But instead, I have cropped backtraces in perf script, like
a.out 2869 [000] 19414.348571: 225426 cycles:ppp:
7ac f (/opt/usr/home/owner/a.out)
beb3dd2c [unknown] ([unknown])
a.out 2869 [000] 19414.348754: 235721 cycles:ppp:
72c g1 (/opt/usr/home/owner/a.out)
beb3dd24 [unknown] ([unknown])
a.out 2869 [000] 19414.348937: 246486 cycles:ppp:
670 g3 (/opt/usr/home/owner/a.out)
beb3dd14 [unknown] ([unknown])
a.out 2869 [000] 19414.349121: 232929 cycles:ppp:
60c g4 (/opt/usr/home/owner/a.out)
beb3dd04 [unknown] ([unknown])
How can I get more info about my backtraces?
Compile: arm-linux-gnueabi-gcc -O0 -g3 -marm -fno-omit-frame-pointer -funwind-tables main.c
Perf record: perf record -g -a
Perf script: perf script
Target is running on Linux 3.10.65.
Upvotes: 1
Views: 658
Reputation: 94475
There were problems with stack unwinding implementation in perf for ARM: Not implemented at some moment. Try recent kernel and/or recent version of perf (new perf tool will work on old kernel, but part of backtrace reading is in kernel).
https://wiki.linaro.org/LEG/Engineering/TOOLS/perf-callstack-unwinding (also mentioned there: How does linux's perf utility understand stack traces?)
Linux perf has architecture specific support code. x86 has some dwarf stack frame unwinding support whilst arm and arm64 do not. It should be implemented on ARM32/64. The work for ARMv7 is done under LEG-760 blueprint. .. The expected result is the backtrace of user and kernel call chain in the perf output statistics.
Support was commited after september 2013: http://www.spinics.net/lists/kernel/msg1608919.html and 3.10 is from june 2013.
Try kernel&perf from 3.11, or any newer version of kernel.
Upvotes: 1