diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-10-01 23:06:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-01 23:06:16 -0700 |
| commit | 8f5f92a07a1c3116eae83cbd4ad550f6d268bbe9 (patch) | |
| tree | 6fa5b251a66d0b679f7de1c6530113e960fa4b6b /src/librustc_codegen_llvm/lib.rs | |
| parent | 0e88e56a9a535bc0bf3b6c88f08a67ac33589c4a (diff) | |
| parent | d94262272bbdc700689a012a2e8a34adbe2a0f18 (diff) | |
| download | rust-8f5f92a07a1c3116eae83cbd4ad550f6d268bbe9.tar.gz rust-8f5f92a07a1c3116eae83cbd4ad550f6d268bbe9.zip | |
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
Diffstat (limited to 'src/librustc_codegen_llvm/lib.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 309a17a01e3..87eab484faf 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -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) |
