Search code examples
linuxperf

Perf trace calling function


I am learning how to use perf. I have used perf stat followed by perf report. So I noticed that I was getting cache misses in memcpy. Is it possible to do a backtrace of some sort to figure out which memcpy this is? Just knowing that it's from memcpy is pretty useless.


Solution

  • Passing -g flag to perf record will make it collect the call stacks with each event. Viewing perf report for a trace collected with the -g flag will help you understand where the problematic memcpy was called from. You may also want to use the --children flag of the perf report command.