From ad84934e6f87fbacb38ec9ec8068c870a1cb9c48 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Sat, 16 Mar 2024 21:35:10 +0100 Subject: [PATCH] rustc-metadata: Store crate name in self-profile of metadata_register_crate When profiling a build of Zed, I found myself in need of names of crates that take the longest to register in downstream crates. --- compiler/rustc_metadata/src/creader.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs index 72757d90e42..20c992ef0c4 100644 --- a/compiler/rustc_metadata/src/creader.rs +++ b/compiler/rustc_metadata/src/creader.rs @@ -397,7 +397,8 @@ fn register_crate( name: Symbol, private_dep: Option, ) -> Result { - let _prof_timer = self.sess.prof.generic_activity("metadata_register_crate"); + let _prof_timer = + self.sess.prof.generic_activity_with_arg("metadata_register_crate", name.as_str()); let Library { source, metadata } = lib; let crate_root = metadata.get_root();