- Notifications
You must be signed in to change notification settings - Fork18
Export Julia profiles to the pprof format
License
JuliaPerf/PProf.jl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Sometimes I need a hammer, sometimes I need a drill, this is a hammer-drill
using Profileusing PProf# Collect a profileProfile.clear()@profilepeakflops()# Export pprof profile and open interactive profiling web interface.pprof()
This prints a link to a local webserver where you can inspect the profile you've collected. It produces a file calledprofile.pb.gz
in thepprof
format, and then opens thepprof
tool in interactive "web" mode.
To profile allocations instead of CPU time, simply use the equivalent functions from theAllocs
submodule instead:
# Collect an allocation profileProfile.Allocs.clear()Profile.Allocs.@profilepeakflops()# Export pprof allocation profile and open interactive profiling web interface.PProf.Allocs.pprof()
For more usage examples see the pprof docs:https://github.com/google/pprof/blob/master/doc/README.md
- Graphviz
- In order to use pprof's web graph view (which is one of the best parts of pprof), you need to have graphviz installed. Click the above link to install.
help?> pprofpprof([data, [lidict]]; web=true, webhost="localhost", webport=57599, out="profile.pb.gz", from_c=true, full_signatures=true, drop_frames="", keep_frames="", ui_relative_percentages=true, sampling_delay=nothing, )pprof(FlameGraphs.flamegraph(); kwargs...) Fetches the collected`Profile` data, exports to the`pprof` format, and (optionally) opens a`pprof` web-serverfor interactively viewing the results.
help?>@pprof@pprof ex Profiles the expressionusing@profile and starts or restarts thepprof() web UI with default arguments.
Callingpprof()
or@pprof
exports the profiling results to disk, and launches the web server in the background pointed at the results. Calling it again overwrites the results and refreshes the server, so you can reload the web-page to see your updated results. The link to the webserver is printed to your terminal, which you can then open in a browser.
If you manually modify the output profile file, you canrefresh the web server without overwriting theout
file by callingPProf.refresh()
.
julia>using PProfjulia>@pprofpeakflops()"profile.pb.gz"Main binary filename not available.Serving web UI on http://localhost:57599
About
Export Julia profiles to the pprof format
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.