Issue
I'm running perf on a kernel 5.4.80
and explicitly use fp
call graph:
perf record -g --call-graph fp ...
When running perf script
it can profile the stack trace without any problem. This is while the kernel is not compiled with frame pointer enabled, rather with ORC:
CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
The result is that the kernel symbols are available in /proc/kallsyms
.
On the other hand, seems perf-script
only knows about fp
, dwarf
and lbr
: source.
I am wondering how perf script is able to unwind the stack and generate the report despite recording with fp
call graph option on a kernel with ORC
stack unwinding enabled?
Solution
According to perf-record(1),
--call-graph
Setup and enable call-graph (stack chain/backtrace)
recording, implies -g. Default is "fp" (for user space).
The unwinding method used for kernel space is dependent on the
unwinder used by the active kernel configuration, i.e
CONFIG_UNWINDER_FRAME_POINTER (fp) or CONFIG_UNWINDER_ORC (orc)
Any option specified here controls the method used for user space.
So, --call-graph
only controls how the call-graph is unwound in userspace. In kernel space, whichever unwinder is actively enabled is used.
Answered By - Sagar Answer Checked By - David Goodson (WPSolving Volunteer)