1
Fork 0

Enable tracing for all queryies

This commit is contained in:
Oli Scherer 2022-05-04 08:30:13 +00:00
parent 9add63257b
commit 0d5a738b8b
4 changed files with 6 additions and 1 deletions

View file

@ -20,6 +20,7 @@ rustc_query_system = { path = "../rustc_query_system" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
tracing = "0.1"
[features]
rustc_use_parallel_compiler = ["rustc-rayon-core", "rustc_query_system/rustc_use_parallel_compiler"]

View file

@ -435,6 +435,8 @@ macro_rules! define_queries {
fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: DepNode) -> bool {
if let Some(key) = recover(tcx, dep_node) {
#[cfg(debug_assertions)]
let _guard = tracing::span!(tracing::Level::TRACE, stringify!($name), ?key).entered();
let tcx = QueryCtxt::from_tcx(tcx);
force_query::<queries::$name<'_>, _>(tcx, key, dep_node);
true
@ -532,6 +534,7 @@ macro_rules! define_queries_struct {
$($(#[$attr])*
#[inline(always)]
#[tracing::instrument(level = "trace", skip(self, tcx))]
fn $name(
&'tcx self,
tcx: TyCtxt<$tcx>,