mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
parent
20eb927843
commit
719b5aba24
8 changed files with 140 additions and 115 deletions
|
@ -88,7 +88,7 @@ use style::values::computed::{CSSPixelLength, FontSize, Length, NonNegativeLengt
|
|||
use style::values::specified::font::KeywordInfo;
|
||||
use style::{driver, Zero};
|
||||
use style_traits::{CSSPixel, DevicePixel, SpeculativePainter};
|
||||
use tracing::{span, Level};
|
||||
use tracing::{instrument, span, Level};
|
||||
use url::Url;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::{units, ExternalScrollId, HitTestFlags};
|
||||
|
@ -254,7 +254,7 @@ impl Layout for LayoutThread {
|
|||
);
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn add_stylesheet(
|
||||
&mut self,
|
||||
stylesheet: ServoArc<Stylesheet>,
|
||||
|
@ -274,7 +274,7 @@ impl Layout for LayoutThread {
|
|||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn remove_stylesheet(&mut self, stylesheet: ServoArc<Stylesheet>) {
|
||||
let guard = stylesheet.shared_lock.read();
|
||||
let stylesheet = DocumentStyleSheet(stylesheet.clone());
|
||||
|
@ -283,22 +283,22 @@ impl Layout for LayoutThread {
|
|||
.remove_all_web_fonts_from_stylesheet(&stylesheet);
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_content_box(&self, node: OpaqueNode) -> Option<UntypedRect<Au>> {
|
||||
process_content_box_request(node, self.fragment_tree.borrow().clone())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_content_boxes(&self, node: OpaqueNode) -> Vec<UntypedRect<Au>> {
|
||||
process_content_boxes_request(node, self.fragment_tree.borrow().clone())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_client_rect(&self, node: OpaqueNode) -> UntypedRect<i32> {
|
||||
process_node_geometry_request(node, self.fragment_tree.borrow().clone())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_element_inner_outer_text(
|
||||
&self,
|
||||
node: script_layout_interface::TrustedNodeAddress,
|
||||
|
@ -316,7 +316,7 @@ impl Layout for LayoutThread {
|
|||
None
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_nodes_from_point(
|
||||
&self,
|
||||
point: UntypedPoint2D<f32>,
|
||||
|
@ -339,12 +339,12 @@ impl Layout for LayoutThread {
|
|||
results.iter().map(|result| result.node.into()).collect()
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_offset_parent(&self, node: OpaqueNode) -> OffsetParentResponse {
|
||||
process_offset_parent_query(node, self.fragment_tree.borrow().clone())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_resolved_style(
|
||||
&self,
|
||||
node: TrustedNodeAddress,
|
||||
|
@ -380,7 +380,7 @@ impl Layout for LayoutThread {
|
|||
)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_resolved_font_style(
|
||||
&self,
|
||||
node: TrustedNodeAddress,
|
||||
|
@ -413,12 +413,12 @@ impl Layout for LayoutThread {
|
|||
)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_scrolling_area(&self, node: Option<OpaqueNode>) -> UntypedRect<i32> {
|
||||
process_node_scroll_area_request(node, self.fragment_tree.borrow().clone())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn query_text_indext(
|
||||
&self,
|
||||
node: OpaqueNode,
|
||||
|
@ -663,7 +663,7 @@ impl LayoutThread {
|
|||
}
|
||||
|
||||
/// The high-level routine that performs layout.
|
||||
#[tracing::instrument(skip(self), fields(servo_profiling = true))]
|
||||
#[instrument(skip_all, fields(servo_profiling = true))]
|
||||
fn handle_reflow(&mut self, data: &mut ScriptReflowResult) {
|
||||
let document = unsafe { ServoLayoutNode::new(&data.document) };
|
||||
let document = document.as_document().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue