I'm curious -- suppose I wanted to measure the amount of time that we spend doing trait solving. I used to use
perf for this but I've found that its backtraces have become super unreliable. Could I extend the self-profile to help me get this information?
e.g., by adding hooks at various spots in the code?
If the trait solving is done in a query, then we're already tracking that time under the query
Otherwise, you can use the
SelfProfiler::end_activity() methods like we do here https://github.com/rust-lang/rust/blob/767f59462663fbc55a69d39fc5e1f7f83b6fb37d/src/librustc_codegen_llvm/lib.rs#L331-L345
thanks @Wesley Wiser
I gave this a try and I'm getting data anyway :)
Yeah, I think we should add some extra probes for trait code