tty: Add Tracy spans to heavy functions
Browse files at this commit6ca21e7bfdd559263dbb54fb2bef51c97ba791fcParent: ce6d2111 changed file +13 -5
- src/backend/tty.rs +13 -5
src/backend/tty.rsmodified+13 -5
| @@ -288,9 +288,11 @@ impl Tty { | |||
| 288 | .unwrap(); | 288 | .unwrap(); |
| 289 | 289 | ||
| 290 | let mut libinput = Libinput::new_with_udev(LibinputSessionInterface::from(session.clone())); | 290 | let mut libinput = Libinput::new_with_udev(LibinputSessionInterface::from(session.clone())); |
| 291 | - libinput | 291 | + { |
| 292 | - .udev_assign_seat(&seat_name) | 292 | + let _span = tracy_client::span!("Libinput::udev_assign_seat"); |
| 293 | - .map_err(|()| anyhow!("error assigning the seat to libinput"))?; | 293 | + libinput.udev_assign_seat(&seat_name) |
| 294 | + } | ||
| 295 | + .map_err(|()| anyhow!("error assigning the seat to libinput"))?; | ||
| 294 | 296 | ||
| 295 | let input_backend = LibinputInputBackend::new(libinput.clone()); | 297 | let input_backend = LibinputInputBackend::new(libinput.clone()); |
| 296 | event_loop | 298 | event_loop |
| @@ -567,8 +569,14 @@ impl Tty { | |||
| 567 | let fd = self.session.open(path, open_flags)?; | 569 | let fd = self.session.open(path, open_flags)?; |
| 568 | let device_fd = DrmDeviceFd::new(DeviceFd::from(fd)); | 570 | let device_fd = DrmDeviceFd::new(DeviceFd::from(fd)); |
| 569 | 571 | ||
| 570 | - let (drm, drm_notifier) = DrmDevice::new(device_fd.clone(), true)?; | 572 | + let (drm, drm_notifier) = { |
| 571 | - let gbm = GbmDevice::new(device_fd)?; | 573 | + let _span = tracy_client::span!("DrmDevice::new"); |
| 574 | + DrmDevice::new(device_fd.clone(), true) | ||
| 575 | + }?; | ||
| 576 | + let gbm = { | ||
| 577 | + let _span = tracy_client::span!("GbmDevice::new"); | ||
| 578 | + GbmDevice::new(device_fd) | ||
| 579 | + }?; | ||
| 572 | 580 | ||
| 573 | let display = unsafe { EGLDisplay::new(gbm.clone())? }; | 581 | let display = unsafe { EGLDisplay::new(gbm.clone())? }; |
| 574 | let egl_device = EGLDevice::device_for_display(&display)?; | 582 | let egl_device = EGLDevice::device_for_display(&display)?; |