Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, r=wesleywiser
SelfProfiler API refactoring and part one of event review This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use. The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented. There is still some work to be done for adding new events, especially around trait resolution and the incremental system. r? @wesleywiser
This commit is contained in:
commit
8f5f92a07a
14 changed files with 371 additions and 273 deletions
|
@ -324,8 +324,9 @@ impl CodegenBackend for LlvmCodegenBackend {
|
|||
|
||||
// Run the linker on any artifacts that resulted from the LLVM run.
|
||||
// This should produce either a finished executable or library.
|
||||
sess.profiler(|p| p.start_activity("link_crate"));
|
||||
time(sess, "linking", || {
|
||||
let _prof_timer = sess.prof.generic_activity("link_crate");
|
||||
|
||||
use rustc_codegen_ssa::back::link::link_binary;
|
||||
use crate::back::archive::LlvmArchiveBuilder;
|
||||
|
||||
|
@ -338,7 +339,6 @@ impl CodegenBackend for LlvmCodegenBackend {
|
|||
target_cpu,
|
||||
);
|
||||
});
|
||||
sess.profiler(|p| p.end_activity("link_crate"));
|
||||
|
||||
// Now that we won't touch anything in the incremental compilation directory
|
||||
// any more, we can finalize it (which involves renaming it)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue