aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/compositor.rs
diff options
context:
space:
mode:
authoratbrakhi <atbrakhi@igalia.com>2024-09-05 14:11:12 +0200
committerGitHub <noreply@github.com>2024-09-05 12:11:12 +0000
commit0f24b8c823ec57a6fad309dda4c36dbaab604e89 (patch)
treef8ad917cb484fc381e4167835edc9261c3da16a8 /components/compositing/compositor.rs
parent37e1c3385e03e1976aecfad3b558049c94ad9e76 (diff)
downloadservo-0f24b8c823ec57a6fad309dda4c36dbaab604e89.tar.gz
servo-0f24b8c823ec57a6fad309dda4c36dbaab604e89.zip
Add tracing events (#33189)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Diffstat (limited to 'components/compositing/compositor.rs')
-rw-r--r--components/compositing/compositor.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 6e6b403a1a9..931095e38b6 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -34,6 +34,7 @@ use script_traits::{
};
use servo_geometry::{DeviceIndependentPixel, FramebufferUintLength};
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
+use tracing::{span, Level};
use webrender::{CaptureBits, RenderApi, Transaction};
use webrender_api::units::{
DeviceIntPoint, DeviceIntSize, DevicePoint, DeviceRect, LayoutPoint, LayoutRect, LayoutSize,
@@ -680,6 +681,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
/// Accept messages from content processes that need to be relayed to the WebRender
/// instance in the parent process.
+ #[tracing::instrument(skip(self))]
fn handle_webrender_message(&mut self, msg: ForwardedToCompositorMsg) {
match msg {
ForwardedToCompositorMsg::Layout(ScriptToCompositorMsg::SendInitialTransaction(
@@ -767,6 +769,8 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
display_list_descriptor,
);
+ let span = span!(Level::TRACE, "ScriptToCompositorMsg::BuiltDisplayList");
+ let _enter = span.enter();
let pipeline_id = display_list_info.pipeline_id;
let details = self.pipeline_details(pipeline_id.into());
details.most_recent_display_list_epoch = Some(display_list_info.epoch);
@@ -2053,6 +2057,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
/// Returns Ok if composition was performed or Err if it was not possible to composite for some
/// reason. When the target is [CompositeTarget::SharedMemory], the image is read back from the
/// GPU and returned as Ok(Some(png::Image)), otherwise we return Ok(None).
+ #[tracing::instrument(skip(self))]
fn composite_specific_target(
&mut self,
target: CompositeTarget,
@@ -2268,6 +2273,8 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
},
};
+ let span = span!(Level::TRACE, "ConstellationMsg::ReadyToPresent");
+ let _enter = span.enter();
// Notify embedder that servo is ready to present.
// Embedder should call `present` to tell compositor to continue rendering.
self.waiting_on_present = true;
@@ -2292,7 +2299,10 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
.map(|info| info.framebuffer_id())
}
+ #[tracing::instrument(skip(self))]
pub fn present(&mut self) {
+ let span = span!(Level::TRACE, "Compositor Present Surface");
+ let _enter = span.enter();
if let Err(err) = self.rendering_context.present() {
warn!("Failed to present surface: {:?}", err);
}
@@ -2354,6 +2364,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
);
}
+ #[tracing::instrument(skip(self))]
pub fn receive_messages(&mut self) -> bool {
// Check for new messages coming from the other threads in the system.
let mut compositor_messages = vec![];
@@ -2380,6 +2391,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
true
}
+ #[tracing::instrument(skip(self))]
pub fn perform_updates(&mut self) -> bool {
if self.shutdown_state == ShutdownState::FinishedShuttingDown {
return false;