tools: Improve instrumentation and add it for some layout (#33647)

Improves the instrumentation to skip all function arguments and also add
spans for some layout modes. This is preparation for improving the
performance of flexbox.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-10-05 10:55:40 +02:00 committed by GitHub
parent 20eb927843
commit 719b5aba24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 140 additions and 115 deletions

View file

@ -19,6 +19,7 @@ use style::values::generics::flex::GenericFlexBasis as FlexBasis;
use style::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrNormal};
use style::values::specified::align::AlignFlags;
use style::Zero;
use tracing::instrument;
use super::geom::{FlexAxis, FlexRelativeRect, FlexRelativeSides, FlexRelativeVec2};
use super::{FlexContainer, FlexContainerConfig, FlexItemBox, FlexLevelBox};
@ -338,6 +339,11 @@ struct FlexItemBoxInlineContentSizesInfo {
}
impl FlexContainer {
#[instrument(
name = "FlexContainer::inline_content_sizes",
skip_all,
fields(servo_profiling = true)
)]
pub fn inline_content_sizes(
&mut self,
layout_context: &LayoutContext,
@ -531,6 +537,11 @@ impl FlexContainer {
}
/// <https://drafts.csswg.org/css-flexbox/#layout-algorithm>
#[instrument(
name = "FlexContainer::layout",
skip_all,
fields(servo_profiling = true)
)]
pub(crate) fn layout(
&self,
layout_context: &LayoutContext,
@ -2461,6 +2472,11 @@ impl FlexItemBox {
}
#[allow(clippy::too_many_arguments)]
#[instrument(
name = "FlexContainer::layout_for_block_content_size",
skip_all,
fields(servo_profiling = true)
)]
fn layout_for_block_content_size(
&mut self,
flex_context: &FlexContext,