diff options
author | atbrakhi <atbrakhi@igalia.com> | 2024-11-08 10:05:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-08 09:05:07 +0000 |
commit | 85a9ca7cb6b850f24c06a4bee71a9f61100f1d0c (patch) | |
tree | e25c888e5ba48d4bae16653e7d650eb82ebd5196 /components | |
parent | 645176742813c423c3c5016eaba69a546b286339 (diff) | |
download | servo-85a9ca7cb6b850f24c06a4bee71a9f61100f1d0c.tar.gz servo-85a9ca7cb6b850f24c06a4bee71a9f61100f1d0c.zip |
layout: Add instrumentation for `display_list` (#34128)
* Add instrumentation for display_list
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* review update
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* review fix
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
---------
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Diffstat (limited to 'components')
-rw-r--r-- | components/layout_2020/display_list/clip_path.rs | 8 | ||||
-rw-r--r-- | components/layout_2020/display_list/mod.rs | 4 | ||||
-rw-r--r-- | components/layout_2020/display_list/stacking_context.rs | 8 |
3 files changed, 20 insertions, 0 deletions
diff --git a/components/layout_2020/display_list/clip_path.rs b/components/layout_2020/display_list/clip_path.rs index 299de01ad2a..0a0b40bc7fd 100644 --- a/components/layout_2020/display_list/clip_path.rs +++ b/components/layout_2020/display_list/clip_path.rs @@ -65,6 +65,14 @@ pub(super) fn build_clip_path_clip_chain_if_necessary( } } +#[cfg_attr( + feature = "tracing", + tracing::instrument( + name = "display_list::build_simple_shape", + skip_all, + fields(servo_profiling = true) + ) +)] fn build_simple_shape( shape: BasicShape, layout_box: LayoutRect, diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs index baf0cd890be..34c54a10848 100644 --- a/components/layout_2020/display_list/mod.rs +++ b/components/layout_2020/display_list/mod.rs @@ -181,6 +181,10 @@ impl DisplayList { fragment_tree: &FragmentTree, root_stacking_context: &StackingContext, ) -> (FnvHashMap<BrowsingContextId, Size2D<f32, CSSPixel>>, bool) { + #[cfg(feature = "tracing")] + let span = tracing::span!(tracing::Level::TRACE, "display_list::build"); + #[cfg(feature = "tracing")] + let _enter = span.enter(); let mut builder = DisplayListBuilder { current_scroll_node_id: self.compositor_info.root_reference_frame_id, current_reference_frame_scroll_node_id: self.compositor_info.root_reference_frame_id, diff --git a/components/layout_2020/display_list/stacking_context.rs b/components/layout_2020/display_list/stacking_context.rs index 1571dd999ca..8ba4794b0d9 100644 --- a/components/layout_2020/display_list/stacking_context.rs +++ b/components/layout_2020/display_list/stacking_context.rs @@ -101,6 +101,14 @@ impl DisplayList { SpatialTreeItemKey::new(pipeline_tag, self.spatial_tree_count) } + #[cfg_attr( + feature = "tracing", + tracing::instrument( + name = "display_list::build_stacking_context_tree", + skip_all, + fields(servo_profiling = true) + ) + )] pub fn build_stacking_context_tree( &mut self, fragment_tree: &FragmentTree, |