From 1dcc2102eb590f8343622cebdf98faf77a0f5f41 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 26 Sep 2025 00:23:42 +0200 Subject: [PATCH] tracy: Rename features to profiling-with-tracy and profiling-with-tracy-memory --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/gpui/src/platform/windows/dispatcher.rs | 2 ++ crates/gpui/src/platform/windows/platform.rs | 1 + crates/zed/Cargo.toml | 4 ++-- crates/zed/src/main.rs | 6 +++--- crates/zed/src/zed-main.rs | 3 +-- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a734982fbb72dc959923d1ac7f5a3f9a4804bdd2..b73df50208365974126949300b3a03d596284028 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1460,6 +1460,7 @@ version = "0.1.0" dependencies = [ "anyhow", "log", + "profiling", "simplelog", "windows 0.61.1", "winresource", @@ -16898,7 +16899,6 @@ checksum = "ef54005d3d760186fd662dad4b7bb27ecd5531cdef54d1573ebd3f20a9205ed7" dependencies = [ "loom", "once_cell", - "rustc-demangle", "tracy-client-sys", ] diff --git a/Cargo.toml b/Cargo.toml index 0eb587331f840c80398e4e679e2cec3a58638fb5..4bc34aa15b154e8672aabf2c298715d6770c5c29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -667,7 +667,7 @@ tokio = { version = "1" } tokio-tungstenite = { version = "0.26", features = ["__rustls-tls"] } toml = "0.8" tower-http = "0.4.4" -tracy-client = { version = "0.18.2", default-features = false, features = ["enable", "demangle"] } +tracy-client = "0.18.2" tree-sitter = { version = "0.25.10", features = ["wasm"] } tree-sitter-bash = "0.25.0" tree-sitter-c = "0.23" diff --git a/crates/gpui/src/platform/windows/dispatcher.rs b/crates/gpui/src/platform/windows/dispatcher.rs index 3707a69047cf53cf68a40b3711e135f77dff8be3..fd9f61e48d0d4dc8f390cf050b4ae6e956bd3b94 100644 --- a/crates/gpui/src/platform/windows/dispatcher.rs +++ b/crates/gpui/src/platform/windows/dispatcher.rs @@ -53,6 +53,7 @@ impl WindowsDispatcher { let handler = { let mut task_wrapper = Some(runnable); WorkItemHandler::new(move |_| { + profiling::register_thread!(); task_wrapper.take().unwrap().run(); Ok(()) }) @@ -64,6 +65,7 @@ impl WindowsDispatcher { let handler = { let mut task_wrapper = Some(runnable); TimerElapsedHandler::new(move |_| { + profiling::register_thread!(); task_wrapper.take().unwrap().run(); Ok(()) }) diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs index 5219d8c8177f7c3dc76a7afab258e2c58a0ce6f8..300ff2e01425c22f863f66463bf908b573facfbe 100644 --- a/crates/gpui/src/platform/windows/platform.rs +++ b/crates/gpui/src/platform/windows/platform.rs @@ -246,6 +246,7 @@ impl WindowsPlatform { std::thread::Builder::new() .name("VSyncProvider".to_owned()) .spawn(move || { + profiling::register_thread!(); let vsync_provider = VSyncProvider::new(); loop { vsync_provider.wait_for_vsync(); diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 6818154c6d0b6ef35207df86eb40c5e499237154..52b677cf68e39408f31603a0170d66af0f88429e 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -19,8 +19,8 @@ name = "zed" path = "src/main.rs" [features] -tracy = ["dep:tracy-client", "profiling/profile-with-tracy"] -tracy-memory = ["tracy"] +profile-with-tracy = ["dep:tracy-client", "profiling/profile-with-tracy"] +profile-with-tracy-memory = ["profile-with-tracy"] [dependencies] acp_tools.workspace = true diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 0b546ebcff857dd632ef45012a38fdddf0ccd195..054454ae88a550e6c2e1eff965faa4a420f7b719 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -59,16 +59,16 @@ use zed::{ use crate::zed::OpenRequestKind; -#[cfg(all(feature = "mimalloc", not(features = "tracy-memory")))] +#[cfg(all(feature = "mimalloc", not(features = "profile-with-tracy-memory")))] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; -#[cfg(all(feature = "mimalloc", features = "tracy-memory"))] +#[cfg(all(feature = "mimalloc", features = "profile-with-tracy-memory"))] #[global_allocator] static GLOBAL: tracy_client::ProfiledAllocator = tracy_client::ProfiledAllocator::new(mimalloc::MiMalloc, 100); -#[cfg(all(not(feature = "mimalloc"), feature = "tracy-memory"))] +#[cfg(all(not(feature = "mimalloc"), feature = "profile-with-tracy-memory"))] #[global_allocator] static GLOBAL: tracy_client::ProfiledAllocator = tracy_client::ProfiledAllocator::new(std::alloc::System, 100); diff --git a/crates/zed/src/zed-main.rs b/crates/zed/src/zed-main.rs index 8f4ef0a062fcb7d28f44025fd35e707779a08180..33ff4d0df2ea310e7e4033339545e1eef227ab7b 100644 --- a/crates/zed/src/zed-main.rs +++ b/crates/zed/src/zed-main.rs @@ -2,9 +2,8 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] pub fn main() { - #[cfg(feature = "tracy")] + #[cfg(feature = "profile-with-tracy")] { - tracy_client::register_demangler!(); tracy_client::Client::start(); }