Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
let mut lock = cache.borrow_mut();
if let Some(value) = lock.results.get(key) {
profq_msg!(tcx, ProfileQueriesMsg::CacheHit);
tcx.sess.profiler(|p| p.record_query_hit(Q::CATEGORY));
tcx.sess.profiler(|p| p.record_query_hit(Q::NAME, Q::CATEGORY));
let result = Ok((value.value.clone(), value.index));
#[cfg(debug_assertions)]
{
Expand Down Expand Up @@ -375,7 +375,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {

if dep_node.kind.is_anon() {
profq_msg!(self, ProfileQueriesMsg::ProviderBegin);
self.sess.profiler(|p| p.start_activity(Q::CATEGORY));
self.sess.profiler(|p| p.start_query(Q::NAME, Q::CATEGORY));

let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| {
job.start(self, diagnostics, |tcx| {
Expand All @@ -385,7 +385,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
})
});

self.sess.profiler(|p| p.end_activity(Q::CATEGORY));
self.sess.profiler(|p| p.end_query(Q::NAME, Q::CATEGORY));
profq_msg!(self, ProfileQueriesMsg::ProviderEnd);

self.dep_graph.read_index(dep_node_index);
Expand Down Expand Up @@ -452,14 +452,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {

let result = if let Some(result) = result {
profq_msg!(self, ProfileQueriesMsg::CacheHit);
self.sess.profiler(|p| p.record_query_hit(Q::CATEGORY));
self.sess.profiler(|p| p.record_query_hit(Q::NAME, Q::CATEGORY));

result
} else {
// We could not load a result from the on-disk cache, so
// recompute.

self.sess.profiler(|p| p.start_activity(Q::CATEGORY));
self.sess.profiler(|p| p.start_query(Q::NAME, Q::CATEGORY));

// The diagnostics for this query have already been
// promoted to the current session during
Expand All @@ -472,7 +472,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
})
});

self.sess.profiler(|p| p.end_activity(Q::CATEGORY));
self.sess.profiler(|p| p.end_query(Q::NAME, Q::CATEGORY));
result
};

Expand Down Expand Up @@ -541,7 +541,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
key, dep_node);

profq_msg!(self, ProfileQueriesMsg::ProviderBegin);
self.sess.profiler(|p| p.start_activity(Q::CATEGORY));
self.sess.profiler(|p| p.start_query(Q::NAME, Q::CATEGORY));

let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| {
job.start(self, diagnostics, |tcx| {
Expand All @@ -559,7 +559,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
})
});

self.sess.profiler(|p| p.end_activity(Q::CATEGORY));
self.sess.profiler(|p| p.end_query(Q::NAME, Q::CATEGORY));
profq_msg!(self, ProfileQueriesMsg::ProviderEnd);

if unlikely!(self.sess.opts.debugging_opts.query_dep_graph) {
Expand Down Expand Up @@ -602,7 +602,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
let _ = self.get_query::<Q>(DUMMY_SP, key);
} else {
profq_msg!(self, ProfileQueriesMsg::CacheHit);
self.sess.profiler(|p| p.record_query_hit(Q::CATEGORY));
self.sess.profiler(|p| p.record_query_hit(Q::NAME, Q::CATEGORY));
}
}

Expand Down Expand Up @@ -729,6 +729,7 @@ macro_rules! define_queries_inner {
sess.profiler(|p| {
$(
p.record_computed_queries(
<queries::$name<'_> as QueryConfig<'_>>::NAME,
<queries::$name<'_> as QueryConfig<'_>>::CATEGORY,
self.$name.lock().results.len()
);
Expand Down
Loading