diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-10-23 17:14:46 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-23 17:14:46 +0900 |
| commit | 41850dfea660a9ce9e4895937e64d830b885d09e (patch) | |
| tree | e9b309a2133303b976e96bc4845969aa760d0a18 | |
| parent | 12f32c2f292463132e84eceddd22330ddebe9ad8 (diff) | |
| parent | 66a025378025742a2a867287c4683e1209d15f65 (diff) | |
| download | rust-41850dfea660a9ce9e4895937e64d830b885d09e.tar.gz rust-41850dfea660a9ce9e4895937e64d830b885d09e.zip | |
Rollup merge of #65695 - michaelwoerister:fix-self-profiling-work-item-event-names, r=wesleywiser
self-profiling: Remove module names from some event-ids in codegen backend. Event-IDs are not supposed to contain argument values. Event-IDs are the equivalent of function names. Proper support for parameters will be added to self-profiling down the line. This PR fixes an oversight from https://github.com/rust-lang/rust/pull/64840. r? @wesleywiser
| -rw-r--r-- | src/librustc_codegen_ssa/back/write.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index 8bc815f2c62..762b50f1659 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -259,7 +259,7 @@ fn generate_lto_work<B: ExtraBackendMethods>( needs_thin_lto: Vec<(String, B::ThinBuffer)>, import_only_modules: Vec<(SerializedModule<B::ModuleBuffer>, WorkProduct)> ) -> Vec<(WorkItem<B>, u64)> { - let _prof_timer = cgcx.prof.generic_activity("codegen_run_lto"); + let _prof_timer = cgcx.prof.generic_activity("codegen_generate_lto_work"); let (lto_modules, copy_jobs) = if !needs_fat_lto.is_empty() { assert!(needs_thin_lto.is_empty()); @@ -674,11 +674,11 @@ impl<B: WriteBackendMethods> WorkItem<B> { } } - pub fn name(&self) -> String { + fn profiling_event_id(&self) -> &'static str { match *self { - WorkItem::Optimize(ref m) => format!("optimize: {}", m.name), - WorkItem::CopyPostLtoArtifacts(ref m) => format!("copy post LTO artifacts: {}", m.name), - WorkItem::LTO(ref m) => format!("lto: {}", m.name()), + WorkItem::Optimize(_) => "codegen_module_optimize", + WorkItem::CopyPostLtoArtifacts(_) => "codegen_copy_artifacts_from_incr_cache", + WorkItem::LTO(_) => "codegen_module_perform_lto", } } } @@ -1587,7 +1587,7 @@ fn spawn_work<B: ExtraBackendMethods>( // as a diagnostic was already sent off to the main thread - just // surface that there was an error in this worker. bomb.result = { - let _prof_timer = cgcx.prof.generic_activity(&work.name()); + let _prof_timer = cgcx.prof.generic_activity(work.profiling_event_id()); execute_work_item(&cgcx, work).ok() }; }); |
