tty: Add more trace spans
Browse files at this commit52aee11aa5ee6a027062d23719f3473149a19a31Parent: e2993281 changed file +7 -0
- src/backend/tty.rs +7 -0
src/backend/tty.rsmodified+7 -0
| @@ -146,6 +146,8 @@ impl Tty { | |||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | fn on_udev_event(&mut self, niri: &mut Niri, event: UdevEvent) { | 148 | fn on_udev_event(&mut self, niri: &mut Niri, event: UdevEvent) { |
| 149 | + let _span = tracy_client::span!("Tty::on_udev_event"); | ||
| 150 | + | ||
| 149 | match event { | 151 | match event { |
| 150 | UdevEvent::Added { device_id, path } => { | 152 | UdevEvent::Added { device_id, path } => { |
| 151 | if !self.session.is_active() { | 153 | if !self.session.is_active() { |
| @@ -177,6 +179,8 @@ impl Tty { | |||
| 177 | } | 179 | } |
| 178 | 180 | ||
| 179 | fn on_session_event(&mut self, niri: &mut Niri, event: SessionEvent) { | 181 | fn on_session_event(&mut self, niri: &mut Niri, event: SessionEvent) { |
| 182 | + let _span = tracy_client::span!("Tty::on_session_event"); | ||
| 183 | + | ||
| 180 | match event { | 184 | match event { |
| 181 | SessionEvent::PauseSession => { | 185 | SessionEvent::PauseSession => { |
| 182 | debug!("pausing session"); | 186 | debug!("pausing session"); |
| @@ -573,6 +577,8 @@ impl Tty { | |||
| 573 | } | 577 | } |
| 574 | 578 | ||
| 575 | fn on_vblank(&mut self, niri: &mut Niri, crtc: crtc::Handle, meta: &DrmEventMetadata) { | 579 | fn on_vblank(&mut self, niri: &mut Niri, crtc: crtc::Handle, meta: &DrmEventMetadata) { |
| 580 | + let span = tracy_client::span!("Tty::on_vblank"); | ||
| 581 | + | ||
| 576 | let now = get_monotonic_time(); | 582 | let now = get_monotonic_time(); |
| 577 | 583 | ||
| 578 | let Some(device) = self.output_device.as_mut() else { | 584 | let Some(device) = self.output_device.as_mut() else { |
| @@ -588,6 +594,7 @@ impl Tty { | |||
| 588 | 594 | ||
| 589 | let name = &surface.name; | 595 | let name = &surface.name; |
| 590 | trace!("vblank on {name} {meta:?}"); | 596 | trace!("vblank on {name} {meta:?}"); |
| 597 | + span.emit_text(name); | ||
| 591 | 598 | ||
| 592 | drop(surface.vblank_frame.take()); // Drop the old one first. | 599 | drop(surface.vblank_frame.take()); // Drop the old one first. |
| 593 | let vblank_frame = tracy_client::Client::running() | 600 | let vblank_frame = tracy_client::Client::running() |