[Merged by Bors] - Enable wgpu profiling spans when using bevy's trace feature#5182
[Merged by Bors] - Enable wgpu profiling spans when using bevy's trace feature#5182superdump wants to merge 4 commits intobevyengine:mainfrom
Conversation
mockersf
left a comment
There was a problem hiding this comment.
I think this should be a separate feature from Bevy tracing.
People will often be interested in tracing to profile their system, not always to profile their GPU usage. Ideally we should be able to do both independently
|
In that case I want to rename the wgpu_trace feature to wgpu_api_trace (because it enables a feature that traces the wgpu api calls for debug and replay purposes) and call this new feature for enabling profiling tracing trace_wgpu for consistency with our other trace_* features. Sound ok @mockersf ? |
|
I was wondering - are spans enabled depending on the log level of the emitting crate? If that's the case, reusing the feature would be fine, it would just need more docs, something like: "if you want to see your system spans, set this log level, if you want wgpu spans, set this level, if you want both ..." Otherwise, the feature renaming sounds good! |
Yes, spans are enabled based on the log level defined at the span creation site. The So, I will roll back the changes to the default log filter, and instead add documentation about using |
|
@mockersf I have added documentation into |
|
bors r+ |
# Objective - Enable `wgpu` profiling spans ## Solution - `wgpu` uses the `profiling` crate to add profiling span instrumentation to their code - `profiling` offers multiple 'backends' for profiling, including `tracing` - When the `bevy` `trace` feature is used, add the `profiling` crate with its `profile-with-tracing` feature to enable appropriate profiling spans in `wgpu` using `tracing` which fits nicely into our infrastructure - Bump our default `tracing` subscriber filter to `wgpu=info` from `wgpu=error` so that the profiling spans are not filtered out as they are created at the `info` level. --- ## Changelog - Added: `tracing` profiling support for `wgpu` when using bevy's `trace` feature - Changed: The default `tracing` filter statement for `wgpu` has been changed from the `error` level to the `info` level to not filter out the wgpu profiling spans
# Objective - Document how to do profiling with Tracy # Solution - The documentation of setting `RUST_LOG=info` in order to capture `wgpu` spans depends on #5182
…ne#5182) # Objective - Enable `wgpu` profiling spans ## Solution - `wgpu` uses the `profiling` crate to add profiling span instrumentation to their code - `profiling` offers multiple 'backends' for profiling, including `tracing` - When the `bevy` `trace` feature is used, add the `profiling` crate with its `profile-with-tracing` feature to enable appropriate profiling spans in `wgpu` using `tracing` which fits nicely into our infrastructure - Bump our default `tracing` subscriber filter to `wgpu=info` from `wgpu=error` so that the profiling spans are not filtered out as they are created at the `info` level. --- ## Changelog - Added: `tracing` profiling support for `wgpu` when using bevy's `trace` feature - Changed: The default `tracing` filter statement for `wgpu` has been changed from the `error` level to the `info` level to not filter out the wgpu profiling spans
# Objective - Document how to do profiling with Tracy # Solution - The documentation of setting `RUST_LOG=info` in order to capture `wgpu` spans depends on bevyengine#5182
…ne#5182) # Objective - Enable `wgpu` profiling spans ## Solution - `wgpu` uses the `profiling` crate to add profiling span instrumentation to their code - `profiling` offers multiple 'backends' for profiling, including `tracing` - When the `bevy` `trace` feature is used, add the `profiling` crate with its `profile-with-tracing` feature to enable appropriate profiling spans in `wgpu` using `tracing` which fits nicely into our infrastructure - Bump our default `tracing` subscriber filter to `wgpu=info` from `wgpu=error` so that the profiling spans are not filtered out as they are created at the `info` level. --- ## Changelog - Added: `tracing` profiling support for `wgpu` when using bevy's `trace` feature - Changed: The default `tracing` filter statement for `wgpu` has been changed from the `error` level to the `info` level to not filter out the wgpu profiling spans
# Objective - Document how to do profiling with Tracy # Solution - The documentation of setting `RUST_LOG=info` in order to capture `wgpu` spans depends on bevyengine#5182
…ne#5182) # Objective - Enable `wgpu` profiling spans ## Solution - `wgpu` uses the `profiling` crate to add profiling span instrumentation to their code - `profiling` offers multiple 'backends' for profiling, including `tracing` - When the `bevy` `trace` feature is used, add the `profiling` crate with its `profile-with-tracing` feature to enable appropriate profiling spans in `wgpu` using `tracing` which fits nicely into our infrastructure - Bump our default `tracing` subscriber filter to `wgpu=info` from `wgpu=error` so that the profiling spans are not filtered out as they are created at the `info` level. --- ## Changelog - Added: `tracing` profiling support for `wgpu` when using bevy's `trace` feature - Changed: The default `tracing` filter statement for `wgpu` has been changed from the `error` level to the `info` level to not filter out the wgpu profiling spans
# Objective - Document how to do profiling with Tracy # Solution - The documentation of setting `RUST_LOG=info` in order to capture `wgpu` spans depends on bevyengine#5182
Objective
wgpuprofiling spansSolution
wgpuuses theprofilingcrate to add profiling span instrumentation to their codeprofilingoffers multiple 'backends' for profiling, includingtracingbevytracefeature is used, add theprofilingcrate with itsprofile-with-tracingfeature to enable appropriate profiling spans inwgpuusingtracingwhich fits nicely into our infrastructuretracingsubscriber filter towgpu=infofromwgpu=errorso that the profiling spans are not filtered out as they are created at theinfolevel.Changelog
tracingprofiling support forwgpuwhen using bevy'stracefeaturetracingfilter statement forwgpuhas been changed from theerrorlevel to theinfolevel to not filter out the wgpu profiling spans