From 561ff979d574f496415c0499345d41da2e1f6e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun?= Date: Sun, 23 Apr 2023 14:33:56 +0200 Subject: Add instrumentation (Part 1) (#761) --- src/eval/func.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/eval/func.rs') diff --git a/src/eval/func.rs b/src/eval/func.rs index 29b85f7a..489527ef 100644 --- a/src/eval/func.rs +++ b/src/eval/func.rs @@ -75,6 +75,12 @@ impl Func { /// Call the function with the given arguments. pub fn call_vm(&self, vm: &mut Vm, mut args: Args) -> SourceResult { + let _span = tracing::info_span!( + "call", + name = self.name().unwrap_or(""), + file = 0, + ); + match &self.repr { Repr::Native(native) => { let value = (native.func)(vm, &mut args)?; @@ -111,6 +117,7 @@ impl Func { } /// Call the function with a Vt. + #[tracing::instrument(skip_all)] pub fn call_vt( &self, vt: &mut Vt, @@ -281,6 +288,7 @@ pub enum Param { impl Closure { /// Call the function in the context with the arguments. #[comemo::memoize] + #[tracing::instrument(skip_all)] #[allow(clippy::too_many_arguments)] fn call( this: &Func, @@ -399,6 +407,7 @@ impl<'a> CapturesVisitor<'a> { } /// Visit any node and collect all captured variables. + #[tracing::instrument(skip_all)] pub fn visit(&mut self, node: &SyntaxNode) { match node.cast() { // Every identifier is a potential variable that we need to capture. -- cgit v1.2.3