Skip to content

Commit 41850df

Browse files
authored
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 #64840. r? @wesleywiser
2 parents 12f32c2 + 66a0253 commit 41850df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc_codegen_ssa/back/write.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn generate_lto_work<B: ExtraBackendMethods>(
259259
needs_thin_lto: Vec<(String, B::ThinBuffer)>,
260260
import_only_modules: Vec<(SerializedModule<B::ModuleBuffer>, WorkProduct)>
261261
) -> Vec<(WorkItem<B>, u64)> {
262-
let _prof_timer = cgcx.prof.generic_activity("codegen_run_lto");
262+
let _prof_timer = cgcx.prof.generic_activity("codegen_generate_lto_work");
263263

264264
let (lto_modules, copy_jobs) = if !needs_fat_lto.is_empty() {
265265
assert!(needs_thin_lto.is_empty());
@@ -674,11 +674,11 @@ impl<B: WriteBackendMethods> WorkItem<B> {
674674
}
675675
}
676676

677-
pub fn name(&self) -> String {
677+
fn profiling_event_id(&self) -> &'static str {
678678
match *self {
679-
WorkItem::Optimize(ref m) => format!("optimize: {}", m.name),
680-
WorkItem::CopyPostLtoArtifacts(ref m) => format!("copy post LTO artifacts: {}", m.name),
681-
WorkItem::LTO(ref m) => format!("lto: {}", m.name()),
679+
WorkItem::Optimize(_) => "codegen_module_optimize",
680+
WorkItem::CopyPostLtoArtifacts(_) => "codegen_copy_artifacts_from_incr_cache",
681+
WorkItem::LTO(_) => "codegen_module_perform_lto",
682682
}
683683
}
684684
}
@@ -1587,7 +1587,7 @@ fn spawn_work<B: ExtraBackendMethods>(
15871587
// as a diagnostic was already sent off to the main thread - just
15881588
// surface that there was an error in this worker.
15891589
bomb.result = {
1590-
let _prof_timer = cgcx.prof.generic_activity(&work.name());
1590+
let _prof_timer = cgcx.prof.generic_activity(work.profiling_event_id());
15911591
execute_work_item(&cgcx, work).ok()
15921592
};
15931593
});

0 commit comments

Comments
 (0)