diff options
| author | bors <bors@rust-lang.org> | 2021-09-28 14:55:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-28 14:55:37 +0000 |
| commit | 8f8092cc32ec171becef8ceacec7dbb06c5d7d7e (patch) | |
| tree | d8509a7fb9cc982a3459dcb112b5206e872520ee /compiler/rustc_data_structures/src | |
| parent | 1d71ba862309d59df710078a845c8772ffb22aba (diff) | |
| parent | 9b5aa063d8e9808eacd27a0bf75a85495ff01bd4 (diff) | |
| download | rust-8f8092cc32ec171becef8ceacec7dbb06c5d7d7e.tar.gz rust-8f8092cc32ec171becef8ceacec7dbb06c5d7d7e.zip | |
Auto merge of #89048 - oli-obk:in_tracing_we_trust, r=jackh726
Add more tracing instrumentation I changed or added all this while working on a branch and pulled it out so we can merge it on its own.
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/scc/mod.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/compiler/rustc_data_structures/src/graph/scc/mod.rs b/compiler/rustc_data_structures/src/graph/scc/mod.rs index d8ac815a158..b84f28b6a9e 100644 --- a/compiler/rustc_data_structures/src/graph/scc/mod.rs +++ b/compiler/rustc_data_structures/src/graph/scc/mod.rs @@ -405,6 +405,7 @@ where /// Call this method when `inspect_node` has returned `None`. Having the /// caller decide avoids mutual recursion between the two methods and allows /// us to maintain an allocated stack for nodes on the path between calls. + #[instrument(skip(self, initial), level = "debug")] fn walk_unvisited_node(&mut self, initial: G::Node) -> WalkReturn<S> { struct VisitingNodeFrame<G: DirectedGraph, Successors> { node: G::Node, @@ -451,7 +452,7 @@ where Some(iter) => iter, None => { // This None marks that we still have the initialize this node's frame. - debug!("walk_unvisited_node(depth = {:?}, node = {:?})", depth, node); + debug!(?depth, ?node); debug_assert!(matches!(self.node_states[node], NodeState::NotVisited)); @@ -478,10 +479,7 @@ where return_value.take().into_iter().map(|walk| (*successor_node, Some(walk))); let successor_walk = successors.by_ref().map(|successor_node| { - debug!( - "walk_unvisited_node: node = {:?} successor_ode = {:?}", - node, successor_node - ); + debug!(?node, ?successor_node); (successor_node, self.inspect_node(successor_node)) }); @@ -491,10 +489,7 @@ where // Track the minimum depth we can reach. assert!(successor_min_depth <= depth); if successor_min_depth < *min_depth { - debug!( - "walk_unvisited_node: node = {:?} successor_min_depth = {:?}", - node, successor_min_depth - ); + debug!(?node, ?successor_min_depth); *min_depth = successor_min_depth; *min_cycle_root = successor_node; } @@ -503,16 +498,13 @@ where Some(WalkReturn::Complete { scc_index: successor_scc_index }) => { // Push the completed SCC indices onto // the `successors_stack` for later. - debug!( - "walk_unvisited_node: node = {:?} successor_scc_index = {:?}", - node, successor_scc_index - ); + debug!(?node, ?successor_scc_index); successors_stack.push(successor_scc_index); } None => { let depth = depth + 1; - debug!("walk_node(depth = {:?}, node = {:?})", depth, successor_node); + debug!(?depth, ?successor_node); // Remember which node the return value will come from. frame.successor_node = successor_node; // Start a new stack frame the step into it. |
