JuliaPerf / PProf.jl

Export Julia profiles to the pprof format
MIT License
155 stars 17 forks source link

Go to source from views? #11

Closed antoine-levitt closed 4 years ago

antoine-levitt commented 4 years ago

The web view only gives me names of functions, not source code location, so it's very hard to get what's going on. Is this planned, or am I doing something wrong?

NHDaly commented 4 years ago

I think the "Peek" view in the webview (<host:port>/ui/peek) should show all the source code location you need.

For example:

      Type: events
Showing nodes accounting for 4, 100% of 4 total
----------------------------------------------------------+-------------
      flat  flat%   sum%        cum   cum%   calls calls% + context          
----------------------------------------------------------+-------------
                                                 1   100% |   _new_array /Users/nathan.daly/src/julia/src/array.c:160
         1 25.00% 25.00%          1 25.00%                | _new_array_ /Users/nathan.daly/src/julia/src/array.c:135
----------------------------------------------------------+-------------
                                                 1   100% |   emit_function /Users/nathan.daly/src/julia/src/codegen.cpp
         1 25.00% 50.00%          1 25.00%                | for_each_uniontype_small /Users/nathan.daly/builds/julia-1.3/usr/lib/libjulia.1.3.dylib:-1
----------------------------------------------------------+-------------
...
----------------------------------------------------------+-------------
                                                 4   100% |   macro expansion /Users/nathan.daly/builds/julia-1.3/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:333 (inline)
         0     0%   100%          4   100%                | macro expansion /Users/nathan.daly/builds/julia-1.3/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:118
                                                 4   100% |   REPL.eval_user_input /Users/nathan.daly/builds/julia-1.3/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86
----------------------------------------------------------+-------------
...

There's also the "Source" view in the webview (<host:port>/ui/source), which shows annotated source files, with samples-per-line, but I don't really ever look at that view.

NHDaly commented 4 years ago

Is that what you were looking for?

antoine-levitt commented 4 years ago

Not really, I was thinking of clicking in the flamegraph and getting the source code location from there, as eg ProfileView and StatProfilerHTML do

vchuravy commented 4 years ago

That sounds more like an issue for pprof upstream. https://github.com/google/pprof

antoine-levitt commented 4 years ago

That's my bad, I didn't understand the relationship between pprof and pprof.jl. Sorry about the noise!