Some bits work \o/

This commit is contained in:
Nadja Reitzenstein 2022-06-21 22:48:12 +02:00
parent 287ca9806d
commit aef36fa3d4
2 changed files with 13 additions and 14 deletions

View File

@ -252,7 +252,7 @@ where
{ {
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest { fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest {
let dropped = match (metadata.name(), metadata.target()) { let dropped = match (metadata.name(), metadata.target()) {
(_, "executor::spawn") => { (_, "executor::task") | ("runtime.spawn", _) => {
self.spawn_callsites.insert(metadata); self.spawn_callsites.insert(metadata);
&self.shared.dropped_tasks &self.shared.dropped_tasks
} }

View File

@ -22,7 +22,7 @@ use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use tracing::field::FieldSet; use tracing::field::FieldSet;
use tracing::metadata::Kind; use tracing::metadata::Kind;
use tracing::{Level, Span}; use tracing::{Instrument, Level, Span};
#[derive(Debug)] #[derive(Debug)]
struct Spooler<'a> { struct Spooler<'a> {
@ -111,14 +111,13 @@ impl<'a, 'executor: 'a> Executor<'executor> {
F: Future<Output = R> + Send + 'a, F: Future<Output = R> + Send + 'a,
R: Send + 'a, R: Send + 'a,
{ {
let span = tracing::info_span!( let span = tracing::trace_span!(
parent: &self.span, target: "executor::task",
//target: "executor::spawn", "runtime.spawn",
"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"); tracing::trace!("spawning sendable task");
task.schedule(); task.schedule();
handle handle
@ -129,13 +128,13 @@ impl<'a, 'executor: 'a> Executor<'executor> {
F: Future<Output = R> + 'a, F: Future<Output = R> + 'a,
R: Send + 'a, R: Send + 'a,
{ {
let span = tracing::info_span!( let span = tracing::trace_span!(
parent: &self.span, target: "executor::task",
//target: "executor::spawn", "runtime.spawn",
"runtime.spawn_local"
); );
let _guard = span.enter(); let fut = future.instrument(span);
let (task, handle) = LightProc::recoverable(future, schedule_local());
let (task, handle) = LightProc::recoverable(fut, schedule_local());
tracing::trace!("spawning sendable task"); tracing::trace!("spawning sendable task");
task.schedule(); task.schedule();
handle handle