From aef36fa3d4786d658fb7097e380c1debab08815b Mon Sep 17 00:00:00 2001 From: Nadja Reitzenstein Date: Tue, 21 Jun 2022 22:48:12 +0200 Subject: [PATCH] Some bits work \o/ --- runtime/console/src/lib.rs | 2 +- runtime/executor/src/pool.rs | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/runtime/console/src/lib.rs b/runtime/console/src/lib.rs index d0c9305..fb3ba3a 100644 --- a/runtime/console/src/lib.rs +++ b/runtime/console/src/lib.rs @@ -252,7 +252,7 @@ where { fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest { let dropped = match (metadata.name(), metadata.target()) { - (_, "executor::spawn") => { + (_, "executor::task") | ("runtime.spawn", _) => { self.spawn_callsites.insert(metadata); &self.shared.dropped_tasks } diff --git a/runtime/executor/src/pool.rs b/runtime/executor/src/pool.rs index ff422d1..b74e035 100644 --- a/runtime/executor/src/pool.rs +++ b/runtime/executor/src/pool.rs @@ -22,7 +22,7 @@ use std::sync::Arc; use std::time::Duration; use tracing::field::FieldSet; use tracing::metadata::Kind; -use tracing::{Level, Span}; +use tracing::{Instrument, Level, Span}; #[derive(Debug)] struct Spooler<'a> { @@ -111,14 +111,13 @@ impl<'a, 'executor: 'a> Executor<'executor> { F: Future + Send + 'a, R: Send + 'a, { - let span = tracing::info_span!( - parent: &self.span, - //target: "executor::spawn", - "runtime.spawn" + let span = tracing::trace_span!( + target: "executor::task", + "runtime.spawn", ); - let _guard = span.enter(); + let fut = future.instrument(span); - let (task, handle) = LightProc::recoverable(future, self.schedule()); + let (task, handle) = LightProc::recoverable(fut, self.schedule()); tracing::trace!("spawning sendable task"); task.schedule(); handle @@ -129,13 +128,13 @@ impl<'a, 'executor: 'a> Executor<'executor> { F: Future + 'a, R: Send + 'a, { - let span = tracing::info_span!( - parent: &self.span, - //target: "executor::spawn", - "runtime.spawn_local" + let span = tracing::trace_span!( + target: "executor::task", + "runtime.spawn", ); - let _guard = span.enter(); - let (task, handle) = LightProc::recoverable(future, schedule_local()); + let fut = future.instrument(span); + + let (task, handle) = LightProc::recoverable(fut, schedule_local()); tracing::trace!("spawning sendable task"); task.schedule(); handle