From b9b59e4f15ad80775315ac1615a127c29725cb77 Mon Sep 17 00:00:00 2001 From: Zahari Dichev Date: Wed, 22 Sep 2021 23:17:41 +0300 Subject: [PATCH] tracing: use structured location fields for spawned tasks (#4128) This change enables `tokio-console` to parse the location information for a spawned task into a structured object rather than simply displaying this info as a field on the task. Signed-off-by: Zahari Dichev --- tokio/src/util/trace.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tokio/src/util/trace.rs b/tokio/src/util/trace.rs index 22cce509f..e3c26f9d6 100644 --- a/tokio/src/util/trace.rs +++ b/tokio/src/util/trace.rs @@ -14,7 +14,9 @@ cfg_trace! { "runtime.spawn", %kind, task.name = %name.unwrap_or_default(), - spawn.location = %format_args!("{}:{}:{}", location.file(), location.line(), location.column()), + loc.file = location.file(), + loc.line = location.line(), + loc.col = location.column(), ); #[cfg(not(tokio_track_caller))] let span = tracing::trace_span!(