Skip to content

perf_to_profile drops perf symbols #81

@rakyll

Description

@rakyll

perf_to_profile drops symbol names when converting from perf output to pprof format.

$ perf record tree /usr
$ perf report
Samples: 4K of event 'cpu-clock:uhH', Event count (approx.): 1236250000
Overhead  Command  Shared Object     Symbol
  12.52%  tree     tree              [.] 0x000000000000c964
  11.06%  tree     libc-2.27.so      [.] vfprintf
   4.63%  tree     libc-2.27.so      [.] write
   4.33%  tree     libc-2.27.so      [.] __lxstat64
   3.84%  tree     libc-2.27.so      [.] _IO_file_xsputn
   3.01%  tree     libc-2.27.so      [.] __fprintf_chk
   2.75%  tree     libc-2.27.so      [.] __strcoll_l
   2.43%  tree     libc-2.27.so      [.] c32rtomb
   1.92%  tree     libc-2.27.so      [.] malloc
   1.80%  tree     libc-2.27.so      [.] 0x000000000016af98
   1.72%  tree     libc-2.27.so      [.] 0x00000000000e00a8
   1.62%  tree     libc-2.27.so      [.] 0x000000000018e5a5
   1.54%  tree     libc-2.27.so      [.] cfree
   1.38%  tree     libc-2.27.so      [.] iswprint
   1.01%  tree     libc-2.27.so      [.] 0x000000000018e590
   0.87%  tree     libc-2.27.so      [.] __open_nocancel
   0.87%  tree     libc-2.27.so      [.] 0x0000000000169d90
   0.75%  tree     libc-2.27.so      [.] __close_nocancel
   0.75%  tree     libc-2.27.so      [.] __fxstat64
   0.75%  tree     libc-2.27.so      [.] readdir64
   0.69%  tree     libc-2.27.so      [.] 0x0000000000169d7a
   0.69%  tree     libc-2.27.so      [.] 0x000000000018e59c
   0.67%  tree     libc-2.27.so      [.] 0x0000000000169d98
   0.67%  tree     libc-2.27.so      [.] 0x000000000018e230
   0.65%  tree     libc-2.27.so      [.] 0x000000000018e69d
   0.61%  tree     tree              [.] 0x000000000000d672
   0.59%  tree     tree              [.] 0x0000000000007bbe
   0.57%  tree     libc-2.27.so      [.] _IO_default_xsputn
   0.53%  tree     libc-2.27.so      [.] 0x000000000018e690
   0.51%  tree     tree              [.] 0x000000000000c949
   0.51%  tree     tree              [.] 0x000000000000c95c
   0.44%  tree     libc-2.27.so      [.] 0x0000000000169d6c
   0.42%  tree     libc-2.27.so      [.] 0x000000000018e22b
   0.42%  tree     tree              [.] 0x000000000000d675
   0.40%  tree     libc-2.27.so      [.] 0x00000000000e00b0
   0.40%  tree     libc-2.27.so      [.] 0x000000000016af9e
   0.38%  tree     libc-2.27.so      [.] _IO_file_overflow
   0.38%  tree     libc-2.27.so      [.] 0x000000000018e227
   0.36%  tree     libc-2.27.so      [.] _IO_file_write
   0.36%  tree     libc-2.27.so      [.] mbstowcs
   0.34%  tree     libc-2.27.so      [.] 0x0000000000169d60
   0.34%  tree     libc-2.27.so      [.] 0x0000000000169de5
   0.32%  tree     libc-2.27.so      [.] _dl_mcount_wrapper_check
...

After conversion pprof data only contains the "Shared Object" name pprof accumulates all profiles under shared object names instead of symbols.

(pprof) top
Showing nodes accounting for 1236000000, 100% of 1236250000 total
Dropped 1 node (cum <= 6181250)
      flat  flat%   sum%        cum   cum%
 956250000 77.35% 77.35%  956250000 77.35%  [libc-2.27.so]
 279750000 22.63%   100%  279750000 22.63%  [tree]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions