Sometimes the results from call-graph profiles may be different from what
you expect to see. The first thing to check is whether the target
binaries where compiled with frame pointers enabled (if the binary was
compiled using gcc's
-fomit-frame-pointer
option, you will not get
meaningful results). Note that as of this writing, the GCC developers
plan to disable frame pointers by default. The Linux kernel is built
without frame pointers by default; there is a configuration option you
can use to turn it on under the "Kernel Hacking" menu.
Often you may see a caller of a function that does not actually directly
call the function you're looking at (e.g. if a()
calls b()
, which in turn calls
c()
, you may see an entry for
a()->c()
). What's actually occurring is that we
are taking samples at the very start (or the very end) of
c()
; at these few instructions, we haven't yet
created the new function's frame, so it appears as if
a()
is calling directly into
c()
. Be careful not to be misled by these
entries.
Like the rest of OProfile, call-graph profiling uses a statistical approach; this means that sometimes a backtrace sample is truncated, or even partially wrong. Bear this in mind when examining results.