# Using perf top with non-stdlib julia code

**URL:** <https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322>\
**Category:** Performance\
**Created:** [August 5, 2022, 3:25am UTC](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322 "2022-08-05T03:25:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ikirill](https://avatars.discourse-cdn.com/v4/letter/i/43a26b/32.png) [@ikirill](https://discourse.julialang.org/u/ikirill)\
**Post date:** [August 5, 2022, 3:25am UTC](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322/1 "2022-08-05T03:25:49Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 5, 2022, 4:13am UTC](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322/2 "2022-08-05T04:13:08Z")

</div>

> [@ikirill](#):
>
> But some Julia code from Julia’s base _is_ resolved.

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

---

<div class="post-metadata">

**Author:** ![ikirill](https://avatars.discourse-cdn.com/v4/letter/i/43a26b/32.png) [@ikirill](https://discourse.julialang.org/u/ikirill)\
**Post date:** [August 5, 2022, 4:27am UTC](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322/3 "2022-08-05T04:27:35Z")

</div>

> [@jling](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![ikirill](https://avatars.discourse-cdn.com/v4/letter/i/43a26b/32.png) [@ikirill](https://discourse.julialang.org/u/ikirill)\
**Post date:** [August 5, 2022, 4:46am UTC](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322/4 "2022-08-05T04:46:51Z")

</div>

> [@jling](#):
>
> why not using Julia’s profiling tools? on master branch you can profile already running program

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