diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index f69fcee7f10e..231e0b7afc77 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -526,6 +526,7 @@ struct SurfaceCompositorRenderResult { } impl SurfaceComposition { + #[profiling::function] fn frame_submitted(&mut self) -> Result>, SwapBuffersError> { match self { SurfaceComposition::Compositor(c) => c.frame_submitted().map_err(Into::::into), @@ -788,6 +789,7 @@ impl AnvilState { notifier, move |event, metadata, data: &mut CalloopData<_>| match event { DrmEvent::VBlank(crtc) => { + profiling::scope!("vblank", &format!("{:?}:{crtc:?}", node.dev_path().unwrap())); data.state.frame_finish(node, crtc, metadata); } DrmEvent::Error(error) => { @@ -1081,6 +1083,11 @@ impl AnvilState { } fn frame_finish(&mut self, dev_id: DrmNode, crtc: crtc::Handle, metadata: &mut Option) { + profiling::scope!( + "frame_finish", + &format!("{:?}:{crtc:?}", dev_id.dev_path().unwrap()) + ); + let device_backend = match self.backend_data.backends.get_mut(&dev_id) { Some(backend) => backend, None => { diff --git a/src/backend/drm/compositor/mod.rs b/src/backend/drm/compositor/mod.rs index 3e0ae3dfa8b6..c67305c8a757 100644 --- a/src/backend/drm/compositor/mod.rs +++ b/src/backend/drm/compositor/mod.rs @@ -2434,6 +2434,7 @@ where /// *Note*: Needs to be called, after the vblank event of the matching [`DrmDevice`](super::super::DrmDevice) /// was received after calling [`DrmCompositor::queue_frame`] on this surface. /// Otherwise the underlying swapchain will run out of buffers eventually. + #[profiling::function] pub fn frame_submitted(&mut self) -> FrameResult, A, F> { if let Some((mut pending, user_data)) = self.pending_frame.take() { std::mem::swap(&mut pending, &mut self.current_frame);