Using perf top with non-stdlib julia code

When running sudo perf top -p $(pidof -s julia) on a running Julia process, none of the function addresses are resolved to names:

Samples: 39K of event 'cycles', 4000 Hz, Event count (approx.): 22211461168 lost: 0/0 drop: 0/0
Overhead  Shared Object             Symbol
  34.52%  [JIT] tid 87617           [.] 0x00007f144fad4de9
  25.65%  [JIT] tid 87617           [.] 0x00007f144fad4db5
   8.46%  [JIT] tid 87617           [.] 0x00007f144fad4db2
   6.52%  [JIT] tid 87617           [.] 0x00007f144fad4deb
   6.42%  [JIT] tid 87617           [.] 0x00007f144fad4db4
   5.87%  [JIT] tid 87617           [.] 0x00007f144fad4ded
   1.64%  [JIT] tid 87617           [.] 0x00007f144fad4de0
   1.58%  [JIT] tid 87617           [.] 0x00007f144fad4dcf
   1.51%  [JIT] tid 87617           [.] 0x00007f144fad4dd6
   1.42%  [JIT] tid 87617           [.] 0x00007f144fad4db0
   1.17%  [JIT] tid 87617           [.] 0x00007f144fad4dbc
   0.66%  [JIT] tid 87617           [.] 0x00007f144fad4ddc
   0.57%  [JIT] tid 87617           [.] 0x00007f144fad4de4
   0.42%  [JIT] tid 87617           [.] 0x00007f144fad4dd3
   0.40%  [JIT] tid 87617           [.] 0x00007f144fad4de2
   0.36%  [JIT] tid 87617           [.] 0x00007f144fad4db8
   0.33%  libjulia-internal.so.1.7  [.] jl_module_names
   0.29%  libc-2.33.so              [.] __strcmp_avx2
   0.29%  [JIT] tid 87617           [.] 0x00007f144fad4dd9
   0.21%  [JIT] tid 87617           [.] 0x00007f144fad4dcc
   0.20%  libjulia-internal.so.1.7  [.] jl_get_binding_
   0.17%  libjulia-internal.so.1.7  [.] jl_isa
   0.15%  libjulia-internal.so.1.7  [.] ptrhash_get
   0.11%  sys.so                    [.] julia_sortNOT._35705.clone_1.clone_2

This is understandable because it’s jitted code. But some Julia code from Julia’s base is resolved.

Does anybody know if there’s a project/patch that might help with showing correct symbols in perf top? It seems that there is support for this in NodeJS, but it required some internal changes to pass some data to perf, and I haven’t run NodeJS yet to find out how it works.

Any pointers would be welcome.

probably because they are close to “boot strap function” and inside system image?

why not using Julia’s profiling tools? on master branch you can profile already running program

perf is a nice standard tool on linux, and I use it often when debugging performance issues. It would be really nice if it worked, just in general.

Oh that’s cool, thanks! It even prints stacktraces on SIGUSR1, I wish I’d known about that earlier.

1 Like