bbc
bbc

Reputation: 1101

perf profiler result

I am new to perf,

try to understand the result, but how to read something like this?

 39.57%  TestSoft.exe  libc-2.15.so         [.] 0x3fd59
  7.04%  TestSoft.exe  libc-2.15.so         [.] malloc
  6.15%  TestSoft.exe  LoanSoft.exe         [.] LoanDef::update_vec()

the first line might be some function in libc, but which function was it? what does that 0x3fd59 mean? also, for second line, which function in my code calls malloc? for the third line, can I further make perf on that function only to see which part of update_vec() was slow?

Thanks a lot!

Upvotes: 1

Views: 803

Answers (2)

perilbrain
perilbrain

Reputation: 8207

Since the dump is of all the functions from user mode, its suggested to compile with debug symbols.0x3fd59 is a routine whose actual name is not available due to missing symbol.
See here to do your analysis at Source level.

 39.57%  TestSoft.exe  libc-2.15.so         [.] 0x3fd59
  7.04%  TestSoft.exe  libc-2.15.so         [.] malloc
  6.15%  TestSoft.exe  LoanSoft.exe         [.] LoanDef::update_vec()

First indicates the percentage of the overall samples collected in the corresponding function.

The second column reports the process from which the samples were collected.

The third column shows the name of the ELF image where the samples came from. If a program is dynamically linked, then this may show the name of a shared library. When the samples come from the kernel, then the pseudo ELF image name [kernel.kallsyms] is used.

The fourth column indicates the privilege level at which the sample was taken, i.e. when the program was running when it was interrupted:

   [.] : user level
   [k]: kernel level
   [g]: guest kernel level (virtualization)
   [u]: guest os user space
   [H]: hypervisor

The final column shows the symbol name.

Upvotes: 2

BЈовић
BЈовић

Reputation: 64283

You need to build with debug symbols (-g option passed to g++ when compiling). Then you will be able to see which function uses that CPU time. You also need to use libraries with debug symbols.

Upvotes: 2

Related Questions