Add more Tracy spans to initialization

This commit is contained in:
Ivan Molodetskikh
2025-11-18 21:25:35 +03:00
parent d7ce12a540
commit ce6d211485
3 changed files with 7 additions and 0 deletions
+1
View File
@@ -56,6 +56,7 @@ impl OutputId {
impl Backend {
pub fn init(&mut self, niri: &mut Niri) {
let _span = tracy_client::span!("Backend::init");
match self {
Backend::Tty(tty) => tty.init(niri),
Backend::Winit(winit) => winit.init(niri),
+4
View File
@@ -269,6 +269,8 @@ impl Tty {
config: Rc<RefCell<Config>>,
event_loop: LoopHandle<'static, State>,
) -> anyhow::Result<Self> {
let _span = tracy_client::span!("Tty::new");
let (session, notifier) = LibSeatSession::new().context(
"Error creating a session. This might mean that you're trying to run niri on a TTY \
that is already busy, for example if you're running this inside tmux that had been \
@@ -559,6 +561,8 @@ impl Tty {
return Ok(());
}
let _span = tracy_client::span!("Tty::device_added");
let open_flags = OFlags::RDWR | OFlags::CLOEXEC | OFlags::NOCTTY | OFlags::NONBLOCK;
let fd = self.session.open(path, open_flags)?;
let device_fd = DrmDeviceFd::new(DeviceFd::from(fd));
+2
View File
@@ -36,6 +36,8 @@ impl Winit {
config: Rc<RefCell<Config>>,
event_loop: LoopHandle<State>,
) -> Result<Self, winit::Error> {
let _span = tracy_client::span!("Winit::new");
let builder = Window::default_attributes()
.with_inner_size(LogicalSize::new(1280.0, 800.0))
// .with_resizable(false)