Describe the bug
When you restart the application that you're profiling and have removed or otherwise changed the profiling scopes, puffin_viewer will mislabel the scopes. Specifically, every scope that follows the removed scope in initialization order will be labeled as the previous scope in initialization order. This can be especially bad in multithreaded applications where scope initialization order can differ between application restarts, without having to change the code at all.
Workaround: Restarting puffin_viewer each time you profile.
To Reproduce
Steps to reproduce the behavior:
Start puffin_viewer
In this repo, run the server example with cargo run --example server
Observe the viewer showing correct profile data
Remove the following profile scope from puffin_http/examples/server.rs line 16:
Describe the bug When you restart the application that you're profiling and have removed or otherwise changed the profiling scopes,
puffin_viewer
will mislabel the scopes. Specifically, every scope that follows the removed scope in initialization order will be labeled as the previous scope in initialization order. This can be especially bad in multithreaded applications where scope initialization order can differ between application restarts, without having to change the code at all.Workaround: Restarting
puffin_viewer
each time you profile.To Reproduce Steps to reproduce the behavior:
puffin_viewer
cargo run --example server
puffin_http/examples/server.rs
line 16:Expected behavior The profiler correctly labeling all scopes :D
Screenshots First run:
Second run with a scope removed:
Device:
Additional context Thanks for making this simple yet awesome profiler :heart:
Also it would be nice if you'd add to
puffin_viewer
's readme thatsudo apt install libgtk-3-dev
is required on Linux. Thanks