From 1029a8fbaf5271b6eb3e4e51f9e5cb015c52f760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yara=20=F0=9F=8F=B3=EF=B8=8F=E2=80=8D=E2=9A=A7=EF=B8=8F?= Date: Thu, 11 Dec 2025 23:29:47 +0100 Subject: [PATCH] Add support for manual spans, expand instrumentation (#44663) Release Notes: - N/A --------- Co-authored-by: Cameron --- Cargo.lock | 3 ++ crates/editor/src/display_map.rs | 42 +++++++++++++++++++ crates/editor/src/display_map/block_map.rs | 12 +++++- crates/editor/src/display_map/wrap_map.rs | 6 ++- crates/editor/src/editor.rs | 2 + .../editor/src/highlight_matching_bracket.rs | 1 + crates/git_ui/src/conflict_view.rs | 3 ++ crates/multi_buffer/src/multi_buffer.rs | 4 ++ crates/search/Cargo.toml | 6 +++ crates/search/src/project_search.rs | 1 + crates/zed/src/main.rs | 4 +- crates/ztracing/Cargo.toml | 1 + crates/ztracing/src/lib.rs | 38 ++++++++++++++++- 13 files changed, 118 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5de8cdd6a648e5ab1f43f8ddfc2c0e37983b279f..e0989e7212c4d4d6a92931e01f2de263324bddae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14445,12 +14445,14 @@ dependencies = [ "settings", "smol", "theme", + "tracing", "ui", "unindent", "util", "util_macros", "workspace", "zed_actions", + "ztracing", ] [[package]] @@ -21022,6 +21024,7 @@ dependencies = [ "tracing", "tracing-subscriber", "tracing-tracy", + "zlog", "ztracing_macro", ] diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs index 081e8ec2e5c3fed341d9949689f6d8bbbb7ccf1c..cab5b3686ee2f77dade059b434b1090cf9b2f7e5 100644 --- a/crates/editor/src/display_map.rs +++ b/crates/editor/src/display_map.rs @@ -56,6 +56,7 @@ use sum_tree::{Bias, TreeMap}; use text::{BufferId, LineIndent}; use ui::{SharedString, px}; use unicode_segmentation::UnicodeSegmentation; +use ztracing::instrument; use std::{ any::TypeId, @@ -168,6 +169,7 @@ impl DisplayMap { } } + #[instrument(skip_all)] pub fn snapshot(&mut self, cx: &mut Context) -> DisplaySnapshot { let tab_size = Self::tab_size(&self.buffer, cx); @@ -195,6 +197,7 @@ impl DisplayMap { } } + #[instrument(skip_all)] pub fn set_state(&mut self, other: &DisplaySnapshot, cx: &mut Context) { self.fold( other @@ -211,6 +214,7 @@ impl DisplayMap { } /// Creates folds for the given creases. + #[instrument(skip_all)] pub fn fold(&mut self, creases: Vec>, cx: &mut Context) { let buffer_snapshot = self.buffer.read(cx).snapshot(cx); let edits = self.buffer_subscription.consume().into_inner(); @@ -279,6 +283,7 @@ impl DisplayMap { } /// Removes any folds with the given ranges. + #[instrument(skip_all)] pub fn remove_folds_with_type( &mut self, ranges: impl IntoIterator>, @@ -304,6 +309,7 @@ impl DisplayMap { } /// Removes any folds whose ranges intersect any of the given ranges. + #[instrument(skip_all)] pub fn unfold_intersecting( &mut self, ranges: impl IntoIterator>, @@ -335,6 +341,7 @@ impl DisplayMap { block_map.remove_intersecting_replace_blocks(offset_ranges, inclusive); } + #[instrument(skip_all)] pub fn disable_header_for_buffer(&mut self, buffer_id: BufferId, cx: &mut Context) { let snapshot = self.buffer.read(cx).snapshot(cx); let edits = self.buffer_subscription.consume().into_inner(); @@ -349,6 +356,7 @@ impl DisplayMap { block_map.disable_header_for_buffer(buffer_id) } + #[instrument(skip_all)] pub fn fold_buffers( &mut self, buffer_ids: impl IntoIterator, @@ -367,6 +375,7 @@ impl DisplayMap { block_map.fold_buffers(buffer_ids, self.buffer.read(cx), cx) } + #[instrument(skip_all)] pub fn unfold_buffers( &mut self, buffer_ids: impl IntoIterator, @@ -385,14 +394,17 @@ impl DisplayMap { block_map.unfold_buffers(buffer_ids, self.buffer.read(cx), cx) } + #[instrument(skip_all)] pub(crate) fn is_buffer_folded(&self, buffer_id: language::BufferId) -> bool { self.block_map.folded_buffers.contains(&buffer_id) } + #[instrument(skip_all)] pub(crate) fn folded_buffers(&self) -> &HashSet { &self.block_map.folded_buffers } + #[instrument(skip_all)] pub fn insert_creases( &mut self, creases: impl IntoIterator>, @@ -402,6 +414,7 @@ impl DisplayMap { self.crease_map.insert(creases, &snapshot) } + #[instrument(skip_all)] pub fn remove_creases( &mut self, crease_ids: impl IntoIterator, @@ -411,6 +424,7 @@ impl DisplayMap { self.crease_map.remove(crease_ids, &snapshot) } + #[instrument(skip_all)] pub fn insert_blocks( &mut self, blocks: impl IntoIterator>, @@ -429,6 +443,7 @@ impl DisplayMap { block_map.insert(blocks) } + #[instrument(skip_all)] pub fn resize_blocks(&mut self, heights: HashMap, cx: &mut Context) { let snapshot = self.buffer.read(cx).snapshot(cx); let edits = self.buffer_subscription.consume().into_inner(); @@ -443,10 +458,12 @@ impl DisplayMap { block_map.resize(heights); } + #[instrument(skip_all)] pub fn replace_blocks(&mut self, renderers: HashMap) { self.block_map.replace_blocks(renderers); } + #[instrument(skip_all)] pub fn remove_blocks(&mut self, ids: HashSet, cx: &mut Context) { let snapshot = self.buffer.read(cx).snapshot(cx); let edits = self.buffer_subscription.consume().into_inner(); @@ -461,6 +478,7 @@ impl DisplayMap { block_map.remove(ids); } + #[instrument(skip_all)] pub fn row_for_block( &mut self, block_id: CustomBlockId, @@ -480,6 +498,7 @@ impl DisplayMap { Some(DisplayRow(block_row.0)) } + #[instrument(skip_all)] pub fn highlight_text( &mut self, key: HighlightKey, @@ -507,6 +526,7 @@ impl DisplayMap { self.text_highlights.insert(key, to_insert); } + #[instrument(skip_all)] pub(crate) fn highlight_inlays( &mut self, type_id: TypeId, @@ -526,6 +546,7 @@ impl DisplayMap { } } + #[instrument(skip_all)] pub fn text_highlights(&self, type_id: TypeId) -> Option<(HighlightStyle, &[Range])> { let highlights = self.text_highlights.get(&HighlightKey::Type(type_id))?; Some((highlights.0, &highlights.1)) @@ -538,6 +559,7 @@ impl DisplayMap { self.text_highlights.values() } + #[instrument(skip_all)] pub fn clear_highlights(&mut self, type_id: TypeId) -> bool { let mut cleared = self .text_highlights @@ -566,6 +588,7 @@ impl DisplayMap { .update(cx, |map, cx| map.set_wrap_width(width, cx)) } + #[instrument(skip_all)] pub fn update_fold_widths( &mut self, widths: impl IntoIterator, @@ -597,6 +620,7 @@ impl DisplayMap { self.inlay_map.current_inlays() } + #[instrument(skip_all)] pub(crate) fn splice_inlays( &mut self, to_remove: &[InlayId], @@ -626,6 +650,7 @@ impl DisplayMap { self.block_map.read(snapshot, edits); } + #[instrument(skip_all)] fn tab_size(buffer: &Entity, cx: &App) -> NonZeroU32 { let buffer = buffer.read(cx).as_singleton().map(|buffer| buffer.read(cx)); let language = buffer @@ -675,6 +700,7 @@ pub struct HighlightedChunk<'a> { } impl<'a> HighlightedChunk<'a> { + #[instrument(skip_all)] fn highlight_invisibles( self, editor_style: &'a EditorStyle, @@ -832,6 +858,7 @@ impl DisplaySnapshot { self.buffer_snapshot().widest_line_number() } + #[instrument(skip_all)] pub fn prev_line_boundary(&self, mut point: MultiBufferPoint) -> (Point, DisplayPoint) { loop { let mut inlay_point = self.inlay_snapshot().to_inlay_point(point); @@ -850,6 +877,7 @@ impl DisplaySnapshot { } } + #[instrument(skip_all)] pub fn next_line_boundary( &self, mut point: MultiBufferPoint, @@ -888,6 +916,7 @@ impl DisplaySnapshot { new_start..new_end } + #[instrument(skip_all)] pub fn point_to_display_point(&self, point: MultiBufferPoint, bias: Bias) -> DisplayPoint { let inlay_point = self.inlay_snapshot().to_inlay_point(point); let fold_point = self.fold_snapshot().to_fold_point(inlay_point, bias); @@ -917,6 +946,7 @@ impl DisplaySnapshot { .anchor_at(point.to_offset(self, bias), bias) } + #[instrument(skip_all)] fn display_point_to_inlay_point(&self, point: DisplayPoint, bias: Bias) -> InlayPoint { let block_point = point.0; let wrap_point = self.block_snapshot.to_wrap_point(block_point, bias); @@ -928,6 +958,7 @@ impl DisplaySnapshot { fold_point.to_inlay_point(self.fold_snapshot()) } + #[instrument(skip_all)] pub fn display_point_to_fold_point(&self, point: DisplayPoint, bias: Bias) -> FoldPoint { let block_point = point.0; let wrap_point = self.block_snapshot.to_wrap_point(block_point, bias); @@ -937,6 +968,7 @@ impl DisplaySnapshot { .0 } + #[instrument(skip_all)] pub fn fold_point_to_display_point(&self, fold_point: FoldPoint) -> DisplayPoint { let tab_point = self.tab_snapshot().fold_point_to_tab_point(fold_point); let wrap_point = self.wrap_snapshot().tab_point_to_wrap_point(tab_point); @@ -949,6 +981,7 @@ impl DisplaySnapshot { } /// Returns text chunks starting at the given display row until the end of the file + #[instrument(skip_all)] pub fn text_chunks(&self, display_row: DisplayRow) -> impl Iterator { self.block_snapshot .chunks( @@ -961,6 +994,7 @@ impl DisplaySnapshot { } /// Returns text chunks starting at the end of the given display row in reverse until the start of the file + #[instrument(skip_all)] pub fn reverse_text_chunks(&self, display_row: DisplayRow) -> impl Iterator { (0..=display_row.0).rev().flat_map(move |row| { self.block_snapshot @@ -977,6 +1011,7 @@ impl DisplaySnapshot { }) } + #[instrument(skip_all)] pub fn chunks( &self, display_rows: Range, @@ -995,6 +1030,7 @@ impl DisplaySnapshot { ) } + #[instrument(skip_all)] pub fn highlighted_chunks<'a>( &'a self, display_rows: Range, @@ -1071,6 +1107,7 @@ impl DisplaySnapshot { }) } + #[instrument(skip_all)] pub fn layout_row( &self, display_row: DisplayRow, @@ -1132,6 +1169,7 @@ impl DisplaySnapshot { layout_line.closest_index_for_x(x) as u32 } + #[instrument(skip_all)] pub fn grapheme_at(&self, mut point: DisplayPoint) -> Option { point = DisplayPoint(self.block_snapshot.clip_point(point.0, Bias::Left)); let chars = self @@ -1321,6 +1359,7 @@ impl DisplaySnapshot { .unwrap_or(false) } + #[instrument(skip_all)] pub fn crease_for_buffer_row(&self, buffer_row: MultiBufferRow) -> Option> { let start = MultiBufferPoint::new(buffer_row.0, self.buffer_snapshot().line_len(buffer_row)); @@ -1407,6 +1446,7 @@ impl DisplaySnapshot { } #[cfg(any(test, feature = "test-support"))] + #[instrument(skip_all)] pub fn text_highlight_ranges( &self, ) -> Option>)>> { @@ -1417,6 +1457,7 @@ impl DisplaySnapshot { } #[cfg(any(test, feature = "test-support"))] + #[instrument(skip_all)] pub fn all_text_highlight_ranges( &self, ) -> Vec<(gpui::Hsla, Range)> { @@ -1466,6 +1507,7 @@ impl DisplaySnapshot { /// /// This moves by buffer rows instead of display rows, a distinction that is /// important when soft wrapping is enabled. + #[instrument(skip_all)] pub fn start_of_relative_buffer_row(&self, point: DisplayPoint, times: isize) -> DisplayPoint { let start = self.display_point_to_fold_point(point, Bias::Left); let target = start.row() as isize + times; diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rs index 79d06dbf8b6e27cffffd47d6637c83eadcb00424..9c7f9d8632224208248a6585fc6f94939ee076fe 100644 --- a/crates/editor/src/display_map/block_map.rs +++ b/crates/editor/src/display_map/block_map.rs @@ -529,7 +529,7 @@ impl BlockMap { BlockMapWriter(self) } - #[ztracing::instrument(skip_all, fields(edits))] + #[ztracing::instrument(skip_all, fields(edits = ?edits))] fn sync(&self, wrap_snapshot: &WrapSnapshot, mut edits: WrapPatch) { let _timer = zlog::time!("BlockMap::sync").warn_if_gt(std::time::Duration::from_millis(50)); @@ -570,6 +570,9 @@ impl BlockMap { let mut wrap_point_cursor = wrap_snapshot.wrap_point_cursor(); while let Some(edit) = edits.next() { + let span = ztracing::debug_span!("while edits", edit = ?edit); + let _enter = span.enter(); + let mut old_start = edit.old.start; let mut new_start = edit.new.start; @@ -628,6 +631,8 @@ impl BlockMap { let mut old_end = edit.old.end; let mut new_end = edit.new.end; loop { + let span = ztracing::debug_span!("decide where edit ends loop"); + let _enter = span.enter(); // Seek to the transform starting at or after the end of the edit cursor.seek(&old_end, Bias::Left); cursor.next(); @@ -736,6 +741,10 @@ impl BlockMap { // and then insert the block itself. let mut just_processed_folded_buffer = false; for (block_placement, block) in blocks_in_edit.drain(..) { + let span = + ztracing::debug_span!("for block in edits", block_height = block.height()); + let _enter = span.enter(); + let mut summary = TransformSummary { input_rows: WrapRow(0), output_rows: BlockRow(block.height()), @@ -957,6 +966,7 @@ impl BlockMap { } } +#[ztracing::instrument(skip(tree, wrap_snapshot))] fn push_isomorphic(tree: &mut SumTree, rows: RowDelta, wrap_snapshot: &WrapSnapshot) { if rows == RowDelta(0) { return; diff --git a/crates/editor/src/display_map/wrap_map.rs b/crates/editor/src/display_map/wrap_map.rs index 51d5324c838dc7cb7f4df04b0e58577108aab6c8..4d6b79d06170a22aaffafa05e0f144219e4d20a7 100644 --- a/crates/editor/src/display_map/wrap_map.rs +++ b/crates/editor/src/display_map/wrap_map.rs @@ -840,7 +840,7 @@ impl WrapSnapshot { self.tab_point_to_wrap_point(self.tab_snapshot.clip_point(self.to_tab_point(point), bias)) } - #[ztracing::instrument(skip_all, fields(point, ret))] + #[ztracing::instrument(skip_all, fields(point=?point, ret))] pub fn prev_row_boundary(&self, mut point: WrapPoint) -> WrapRow { if self.transforms.is_empty() { return WrapRow(0); @@ -851,11 +851,14 @@ impl WrapSnapshot { let mut cursor = self .transforms .cursor::>(()); + // start cursor.seek(&point, Bias::Right); + // end if cursor.item().is_none() { cursor.prev(); } + // start while let Some(transform) = cursor.item() { if transform.is_isomorphic() && cursor.start().1.column() == 0 { return cmp::min(cursor.end().0.row(), point.row()); @@ -863,6 +866,7 @@ impl WrapSnapshot { cursor.prev(); } } + // end unreachable!() } diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index c20b928df927a9ce764fe622e1d7f69c8de0c29f..cddb20d83e0b9066fcfd882aa5325624cbadf92e 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -7135,6 +7135,7 @@ impl Editor { Some((query, selection_anchor_range)) } + #[ztracing::instrument(skip_all)] fn update_selection_occurrence_highlights( &mut self, query_text: String, @@ -7279,6 +7280,7 @@ impl Editor { }); } + #[ztracing::instrument(skip_all)] fn refresh_selected_text_highlights( &mut self, on_buffer_edit: bool, diff --git a/crates/editor/src/highlight_matching_bracket.rs b/crates/editor/src/highlight_matching_bracket.rs index eaef28bed21bf480a32c3abd3440a6c41e42d5f1..3ead3e2a11348b0f262926bbfe4fb880f0dff663 100644 --- a/crates/editor/src/highlight_matching_bracket.rs +++ b/crates/editor/src/highlight_matching_bracket.rs @@ -7,6 +7,7 @@ use theme::ActiveTheme; enum MatchingBracketHighlight {} impl Editor { + #[ztracing::instrument(skip_all)] pub fn refresh_matching_bracket_highlights( &mut self, window: &Window, diff --git a/crates/git_ui/src/conflict_view.rs b/crates/git_ui/src/conflict_view.rs index 2f954bfe1045d9819c1f7c276346a6f811c09108..813e63ab8c96e736cf0cc126526a683b418c2137 100644 --- a/crates/git_ui/src/conflict_view.rs +++ b/crates/git_ui/src/conflict_view.rs @@ -111,6 +111,7 @@ fn excerpt_for_buffer_updated( ); } +#[ztracing::instrument(skip_all)] fn buffer_added(editor: &mut Editor, buffer: Entity, cx: &mut Context) { let Some(project) = editor.project() else { return; @@ -166,6 +167,7 @@ fn buffers_removed(editor: &mut Editor, removed_buffer_ids: &[BufferId], cx: &mu editor.remove_blocks(removed_block_ids, None, cx); } +#[ztracing::instrument(skip_all)] fn conflicts_updated( editor: &mut Editor, conflict_set: Entity, @@ -311,6 +313,7 @@ fn conflicts_updated( } } +#[ztracing::instrument(skip_all)] fn update_conflict_highlighting( editor: &mut Editor, conflict: &ConflictRegion, diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index 442abe78ee65ba91ccf8e03ab3c0ad26f3679cfc..5b343ecc5791c0f6f5f8a6d734cb79fc8226a8fa 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -1202,6 +1202,7 @@ impl MultiBuffer { } /// Returns an up-to-date snapshot of the MultiBuffer. + #[ztracing::instrument(skip_all)] pub fn snapshot(&self, cx: &App) -> MultiBufferSnapshot { self.sync(cx); self.snapshot.borrow().clone() @@ -1927,6 +1928,7 @@ impl MultiBuffer { cx.notify(); } + #[ztracing::instrument(skip_all)] pub fn excerpts_for_buffer( &self, buffer_id: BufferId, @@ -2887,6 +2889,7 @@ impl MultiBuffer { cx.notify(); } + #[ztracing::instrument(skip_all)] fn sync(&self, cx: &App) { let changed = self.buffer_changed_since_sync.replace(false); if !changed { @@ -5627,6 +5630,7 @@ impl MultiBufferSnapshot { /// excerpt /// /// Can optionally pass a range_filter to filter the ranges of brackets to consider + #[ztracing::instrument(skip_all)] pub fn innermost_enclosing_bracket_ranges( &self, range: Range, diff --git a/crates/search/Cargo.toml b/crates/search/Cargo.toml index ac07e43fb0317bbe4e11fde98fc3ccbe886baf9d..02eb611fc22570c9028c21bc00187c627198475c 100644 --- a/crates/search/Cargo.toml +++ b/crates/search/Cargo.toml @@ -43,6 +43,8 @@ util_macros.workspace = true workspace.workspace = true zed_actions.workspace = true itertools.workspace = true +ztracing.workspace = true +tracing.workspace = true [dev-dependencies] client = { workspace = true, features = ["test-support"] } @@ -53,3 +55,7 @@ lsp.workspace = true pretty_assertions.workspace = true unindent.workspace = true workspace = { workspace = true, features = ["test-support"] } + +[package.metadata.cargo-machete] +ignored = ["tracing"] + diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index 41de3246532d6fcfe781f9c5c1d2c250f0cae93e..a9ca77a5b8bd30b8492cf8f8dfa2b17fdcdb6a5b 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -1545,6 +1545,7 @@ impl ProjectSearchView { } } + #[ztracing::instrument(skip_all)] fn highlight_matches( &self, match_ranges: &[Range], diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 2e85da2c0622305c4244d7cc15885e0bb4111aa5..dfbc57d293e392f654b0920455e5614dd969bcdb 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -166,8 +166,6 @@ fn fail_to_open_window(e: anyhow::Error, _cx: &mut App) { pub static STARTUP_TIME: OnceLock = OnceLock::new(); pub fn main() { - ztracing::init(); - STARTUP_TIME.get_or_init(|| Instant::now()); #[cfg(unix)] @@ -242,6 +240,7 @@ pub fn main() { } zlog::init(); + if stdout_is_a_pty() { zlog::init_output_stdout(); } else { @@ -251,6 +250,7 @@ pub fn main() { zlog::init_output_stdout(); }; } + ztracing::init(); let version = option_env!("ZED_BUILD_ID"); let app_commit_sha = diff --git a/crates/ztracing/Cargo.toml b/crates/ztracing/Cargo.toml index c68ac15423cf3a26a8dc855769ba44b9ac29696a..0d9f15b9afccca4a1a05036c013562c8ad1ae8f4 100644 --- a/crates/ztracing/Cargo.toml +++ b/crates/ztracing/Cargo.toml @@ -12,6 +12,7 @@ workspace = true tracy = ["tracing-tracy"] [dependencies] +zlog.workspace = true tracing.workspace = true tracing-subscriber = "0.3.22" diff --git a/crates/ztracing/src/lib.rs b/crates/ztracing/src/lib.rs index 1ab687a2f4550e9b08432764dd7f80aedf5791c0..b9b318cc3565d8ced2a5496f1240409542d23c5a 100644 --- a/crates/ztracing/src/lib.rs +++ b/crates/ztracing/src/lib.rs @@ -1,10 +1,46 @@ +pub use tracing::Level; + #[cfg(ztracing)] -pub use tracing::instrument; +pub use tracing::{ + debug_span, error_span, event, info_span, instrument, span, trace_span, warn_span, +}; #[cfg(not(ztracing))] pub use ztracing_macro::instrument; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as trace_span; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as info_span; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as debug_span; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as warn_span; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as error_span; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as event; +#[cfg(not(ztracing))] +pub use __consume_all_tokens as span; + +#[cfg(not(ztracing))] +#[macro_export] +macro_rules! __consume_all_tokens { + ($($t:tt)*) => { + $crate::FakeSpan + }; +} + +pub struct FakeSpan; +impl FakeSpan { + pub fn enter(&self) {} +} + +// #[cfg(not(ztracing))] +// pub use span; + #[cfg(ztracing)] pub fn init() { + zlog::info!("Starting tracy subscriber, you can now connect the profiler"); use tracing_subscriber::prelude::*; tracing::subscriber::set_global_default( tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()),