self-profiling: Add events for tracking crate metadata loading related activities.
This commit is contained in:
parent
9dbd7be70f
commit
003d5a6367
2 changed files with 8 additions and 0 deletions
|
@ -197,6 +197,9 @@ impl<'a> CrateLoader<'a> {
|
|||
dep_kind: DepKind,
|
||||
name: Symbol
|
||||
) -> (CrateNum, Lrc<cstore::CrateMetadata>) {
|
||||
let _prof_timer =
|
||||
self.sess.prof.generic_activity("metadata_register_crate");
|
||||
|
||||
let crate_root = lib.metadata.get_root();
|
||||
self.verify_no_symbol_conflicts(span, &crate_root);
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ macro_rules! provide {
|
|||
$tcx: TyCtxt<$lt>,
|
||||
def_id_arg: T,
|
||||
) -> <ty::queries::$name<$lt> as QueryConfig<$lt>>::Value {
|
||||
let _prof_timer =
|
||||
$tcx.prof.generic_activity("metadata_decode_entry");
|
||||
|
||||
#[allow(unused_variables)]
|
||||
let ($def_id, $other) = def_id_arg.into_args();
|
||||
assert!(!$def_id.is_local());
|
||||
|
@ -444,6 +447,8 @@ impl cstore::CStore {
|
|||
}
|
||||
|
||||
pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
|
||||
let _prof_timer = sess.prof.generic_activity("metadata_load_macro");
|
||||
|
||||
let data = self.get_crate_data(id.krate);
|
||||
if data.is_proc_macro_crate() {
|
||||
return LoadedMacro::ProcMacro(data.load_proc_macro(id.index, sess));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue