Add more Tracy spans to initialization
Browse files at this commitce6d211485709b53422e526f6d57751001dce2b6Parent: d7ce12a3 changed files +7 -0
- src/backend/mod.rs +1 -0
- src/backend/tty.rs +4 -0
- src/backend/winit.rs +2 -0
src/backend/mod.rsmodified+1 -0
| @@ -56,6 +56,7 @@ impl OutputId { | |||
| 56 | 56 | ||
| 57 | impl Backend { | 57 | impl Backend { |
| 58 | pub fn init(&mut self, niri: &mut Niri) { | 58 | pub fn init(&mut self, niri: &mut Niri) { |
| 59 | + let _span = tracy_client::span!("Backend::init"); | ||
| 59 | match self { | 60 | match self { |
| 60 | Backend::Tty(tty) => tty.init(niri), | 61 | Backend::Tty(tty) => tty.init(niri), |
| 61 | Backend::Winit(winit) => winit.init(niri), | 62 | Backend::Winit(winit) => winit.init(niri), |
src/backend/tty.rsmodified+4 -0
| @@ -269,6 +269,8 @@ impl Tty { | |||
| 269 | config: Rc<RefCell<Config>>, | 269 | config: Rc<RefCell<Config>>, |
| 270 | event_loop: LoopHandle<'static, State>, | 270 | event_loop: LoopHandle<'static, State>, |
| 271 | ) -> anyhow::Result<Self> { | 271 | ) -> anyhow::Result<Self> { |
| 272 | + let _span = tracy_client::span!("Tty::new"); | ||
| 273 | + | ||
| 272 | let (session, notifier) = LibSeatSession::new().context( | 274 | let (session, notifier) = LibSeatSession::new().context( |
| 273 | "Error creating a session. This might mean that you're trying to run niri on a TTY \ | 275 | "Error creating a session. This might mean that you're trying to run niri on a TTY \ |
| 274 | that is already busy, for example if you're running this inside tmux that had been \ | 276 | that is already busy, for example if you're running this inside tmux that had been \ |
| @@ -559,6 +561,8 @@ impl Tty { | |||
| 559 | return Ok(()); | 561 | return Ok(()); |
| 560 | } | 562 | } |
| 561 | 563 | ||
| 564 | + let _span = tracy_client::span!("Tty::device_added"); | ||
| 565 | + | ||
| 562 | let open_flags = OFlags::RDWR | OFlags::CLOEXEC | OFlags::NOCTTY | OFlags::NONBLOCK; | 566 | let open_flags = OFlags::RDWR | OFlags::CLOEXEC | OFlags::NOCTTY | OFlags::NONBLOCK; |
| 563 | let fd = self.session.open(path, open_flags)?; | 567 | let fd = self.session.open(path, open_flags)?; |
| 564 | let device_fd = DrmDeviceFd::new(DeviceFd::from(fd)); | 568 | let device_fd = DrmDeviceFd::new(DeviceFd::from(fd)); |
src/backend/winit.rsmodified+2 -0
| @@ -36,6 +36,8 @@ impl Winit { | |||
| 36 | config: Rc<RefCell<Config>>, | 36 | config: Rc<RefCell<Config>>, |
| 37 | event_loop: LoopHandle<State>, | 37 | event_loop: LoopHandle<State>, |
| 38 | ) -> Result<Self, winit::Error> { | 38 | ) -> Result<Self, winit::Error> { |
| 39 | + let _span = tracy_client::span!("Winit::new"); | ||
| 40 | + | ||
| 39 | let builder = Window::default_attributes() | 41 | let builder = Window::default_attributes() |
| 40 | .with_inner_size(LogicalSize::new(1280.0, 800.0)) | 42 | .with_inner_size(LogicalSize::new(1280.0, 800.0)) |
| 41 | // .with_resizable(false) | 43 | // .with_resizable(false) |