Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call stack in the perf profiler

I'm running "perf" in the following way:

perf record -a --call-graph -p some_pid  perf report --call-graph --stdio 

Then, I see this:

 1.60%     my_binary  my_binary                [.] my_func            |            --- my_func               |                         |--71.10%-- (nil)               |          (nil)               |                          --28.90%-- 0x17f310000000a 

I can't see which functions call my_func(). I see "nil" and "0x17f310000000a" instead. Am I doing something wrong? It is probably not a debug info problem because some symbols are shown while others are not shown.

More info:

  • I'm runnning CentOS 6.2 (kernel 2.6.32-220.4.1).
  • perf rpm - perf-2.6.32-279.5.2.el6.x86_64.
like image 539
erezz Avatar asked Aug 28 '12 13:08

erezz


People also ask

How do I read a perf data file?

There is builtin perf. data parser and printer in perf tool of linux tools with subcommand "script". perf-script - Read perf. data (created by perf record) and display trace output This command reads the input file and displays the trace recorded.

What is overhead in perf report?

Overhead: the percentage of overall samples collected in the corresponding function. Command: the command to which the samples belong. Shared object: the name of the image from where the samples came. Symbol: the symbol name which constitutes the sample, and the privilege level at which the sample was taken.

What is perf command in Linux?

The perf command is used as a primary interface to the Linux kernel performance monitoring capabilities and can record CPU performance counters and trace points.

What does perf script do?

DESCRIPTION top. This perf script option is used to process perf script data using perf's built-in Python interpreter. It reads and processes the input file and displays the results of the trace analysis implemented in the given Python script, if any.


1 Answers

Make sure you compiled the code with -fno-omit-frame-pointer gcc option.

like image 134
Andriy Avatar answered Oct 20 '22 21:10

Andriy