From 15c823e14ea728d57bcb79af852d99d294d9dc43 Mon Sep 17 00:00:00 2001 From: tcmal Date: Mon, 19 Jun 2023 12:55:14 +0000 Subject: add tracing --- incria/src/deps.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'incria/src/deps.rs') diff --git a/incria/src/deps.rs b/incria/src/deps.rs index 924eb3f..f2fd8f8 100644 --- a/incria/src/deps.rs +++ b/incria/src/deps.rs @@ -18,6 +18,8 @@ use std::{ thread, }; +use tracing::instrument; + /// Identifier of a node, unique across a program run. pub type NodeId = u64; @@ -40,6 +42,7 @@ struct DepTracker { impl DepTracker { /// See [`self::add_dep`] + #[instrument(level = "trace", skip(self))] fn add_dep(&self, dep: NodeId) { self.deps .lock() @@ -65,6 +68,7 @@ impl DepTracker { } /// See [`self::mark_dirty`] + #[instrument(level = "trace", skip(self))] fn mark_dirty(&self, node: NodeId) { let mut lock = self.deps.lock().unwrap(); let mut frontier = VecDeque::new(); @@ -87,6 +91,7 @@ impl DepTracker { } /// See [`self::is_dirty`] + #[instrument(level = "trace", skip(self))] fn is_dirty(&self, node: NodeId) -> bool { self.deps .lock() @@ -97,6 +102,7 @@ impl DepTracker { } /// See [`self::clear`] + #[instrument(level = "trace", skip(self))] fn clear(&self, node: NodeId) { let mut lock = self.deps.lock().unwrap(); let node = match lock.get_mut(&node) { -- cgit v1.2.3