aclysma / profiling

Provides a very thin abstraction over instrumented profiling crates like puffin, optick, tracy, and superluminal-perf.
Apache License 2.0
320 stars 39 forks source link

Using from a library: could not find `puffin` in `profiling` #74

Open Firestar99 opened 1 week ago

Firestar99 commented 1 week ago

When using profiling from multiple libraries and 2 binaries, all within the same workspace, I'm getting the following error in the libraries:

error[E0433]: failed to resolve: could not find `puffin` in `profiling`
  --> space-asset/src/meshlet/scene.rs:14:3
   |
14 |         #[profiling::function]
   |         ^^^^^^^^^^^^^^^^^^^^^^ could not find `puffin` in `profiling`
   |

That is if I follow your "Using from a Binary / Library" exactly. I can work around this issue by propagating the feature manually from one crate to the next, but this gets ugly fast and let's just hope I didn't forget any library:

[features]
profile-with-puffin = ["profiling/profile-with-puffin", "vulkano-bindless/profile-with-puffin", "vulkano/profile-with-puffin", "space-engine/profile-with-puffin", "space-asset/profile-with-puffin"]
profile-with-optick = ["profiling/profile-with-optick", "vulkano-bindless/profile-with-optick", "vulkano/profile-with-optick", "space-engine/profile-with-optick", "space-asset/profile-with-optick"]
profile-with-superluminal = ["profiling/profile-with-superluminal", "vulkano-bindless/profile-with-superluminal", "vulkano/profile-with-superluminal", "space-engine/profile-with-superluminal", "space-asset/profile-with-superluminal"]
profile-with-tracing = ["profiling/profile-with-tracing", "vulkano-bindless/profile-with-tracing", "vulkano/profile-with-tracing", "space-engine/profile-with-tracing", "space-asset/profile-with-tracing"]
profile-with-tracy = ["profiling/profile-with-tracy", "vulkano-bindless/profile-with-tracy", "vulkano/profile-with-tracy", "space-engine/profile-with-tracy", "space-asset/profile-with-tracy"]

Unfortunately, I have not been able to create a minimal reproducible sample. I'm hoping you could maybe have some ideas on why it does not compile the way it should? https://gitlab.com/spacegamedev/space-rust/-/tree/performance branch performance

aclysma commented 1 week ago

Have you tried using cargo tree to investigate this, as was done in #73 ?