forge
Explore
Log in

Don't you dare go Hollow

Start Tracy manual-lifetime after niri msg

Browse files at this commit

c4ebb9f58e7ea1d2e688d3ee9483a7a1b3dd52b4Ivan MolodetskikhParent: 38e329a
src/main.rsmodified+6 -2
@@ -80,8 +80,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
80 env::set_var("XDG_SESSION_TYPE", "wayland");80 env::set_var("XDG_SESSION_TYPE", "wayland");
81 }81 }
82 82
83- let _client = tracy_client::Client::start();
84-
85 // Set a better error printer for config loading.83 // Set a better error printer for config loading.
86 niri_config::set_miette_hook().unwrap();84 niri_config::set_miette_hook().unwrap();
87 85
@@ -89,6 +87,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
89 if let Some(subcommand) = cli.subcommand {87 if let Some(subcommand) = cli.subcommand {
90 match subcommand {88 match subcommand {
91 Sub::Validate { config } => {89 Sub::Validate { config } => {
90+ tracy_client::Client::start();
91+
92 let path = config92 let path = config
93 .or_else(default_config_path)93 .or_else(default_config_path)
94 .expect("error getting config path");94 .expect("error getting config path");
@@ -104,6 +104,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
104 }104 }
105 }105 }
106 106
107+ // Avoid starting Tracy for the `niri msg` code path since starting/stopping Tracy is a bit
108+ // slow.
109+ tracy_client::Client::start();
110+
107 info!("starting version {}", &version());111 info!("starting version {}", &version());
108 112
109 // Load the config.113 // Load the config.