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

1
Cargo.lock generated
View file

@ -3901,6 +3901,7 @@ dependencies = [
"servo_url", "servo_url",
"style", "style",
"style_traits", "style_traits",
"tracing",
"unicode-bidi", "unicode-bidi",
"unicode-script", "unicode-script",
"url", "url",

View file

@ -36,7 +36,7 @@ use script_traits::{
}; };
use servo_geometry::{DeviceIndependentPixel, FramebufferUintLength}; use servo_geometry::{DeviceIndependentPixel, FramebufferUintLength};
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor}; use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
use tracing::{span, Level}; use tracing::{instrument, span, Level};
use webrender::{CaptureBits, RenderApi, Transaction}; use webrender::{CaptureBits, RenderApi, Transaction};
use webrender_api::units::{ use webrender_api::units::{
DeviceIntPoint, DeviceIntSize, DevicePoint, DeviceRect, LayoutPoint, LayoutRect, LayoutSize, DeviceIntPoint, DeviceIntSize, DevicePoint, DeviceRect, LayoutPoint, LayoutRect, LayoutSize,
@ -684,7 +684,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
/// Accept messages from content processes that need to be relayed to the WebRender /// Accept messages from content processes that need to be relayed to the WebRender
/// instance in the parent process. /// instance in the parent process.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_webrender_message(&mut self, msg: ForwardedToCompositorMsg) { fn handle_webrender_message(&mut self, msg: ForwardedToCompositorMsg) {
match msg { match msg {
ForwardedToCompositorMsg::Layout(ScriptToCompositorMsg::SendInitialTransaction( ForwardedToCompositorMsg::Layout(ScriptToCompositorMsg::SendInitialTransaction(
@ -2056,7 +2056,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
/// Returns Ok if composition was performed or Err if it was not possible to composite for some /// 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 /// 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). /// GPU and returned as Ok(Some(png::Image)), otherwise we return Ok(None).
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn composite_specific_target( fn composite_specific_target(
&mut self, &mut self,
target: CompositeTarget, target: CompositeTarget,
@ -2299,7 +2299,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
.map(|info| info.framebuffer_id()) .map(|info| info.framebuffer_id())
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
pub fn present(&mut self) { pub fn present(&mut self) {
let span = span!( let span = span!(
Level::TRACE, Level::TRACE,
@ -2368,7 +2368,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
); );
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
pub fn receive_messages(&mut self) -> bool { pub fn receive_messages(&mut self) -> bool {
// Check for new messages coming from the other threads in the system. // Check for new messages coming from the other threads in the system.
let mut compositor_messages = vec![]; let mut compositor_messages = vec![];
@ -2395,7 +2395,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
true true
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
pub fn perform_updates(&mut self) -> bool { pub fn perform_updates(&mut self) -> bool {
if self.shutdown_state == ShutdownState::FinishedShuttingDown { if self.shutdown_state == ShutdownState::FinishedShuttingDown {
return false; return false;

View file

@ -152,7 +152,7 @@ use servo_config::{opts, pref};
use servo_rand::{random, Rng, ServoRng, SliceRandom}; use servo_rand::{random, Rng, ServoRng, SliceRandom};
use servo_url::{Host, ImmutableOrigin, ServoUrl}; use servo_url::{Host, ImmutableOrigin, ServoUrl};
use style_traits::CSSPixel; use style_traits::CSSPixel;
use tracing::{span, Level}; use tracing::{instrument, span, Level};
use webgpu::swapchain::WGPUImageMap; use webgpu::swapchain::WGPUImageMap;
use webgpu::{self, WebGPU, WebGPURequest, WebGPUResponse}; use webgpu::{self, WebGPU, WebGPURequest, WebGPUResponse};
use webrender::{RenderApi, RenderApiSender}; use webrender::{RenderApi, RenderApiSender};
@ -1195,7 +1195,7 @@ where
} }
/// Handles loading pages, navigation, and granting access to the compositor /// Handles loading pages, navigation, and granting access to the compositor
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request(&mut self) { fn handle_request(&mut self) {
#[derive(Debug)] #[derive(Debug)]
enum Request { enum Request {
@ -1292,13 +1292,13 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request_for_pipeline_namespace(&mut self, request: PipelineNamespaceRequest) { fn handle_request_for_pipeline_namespace(&mut self, request: PipelineNamespaceRequest) {
let PipelineNamespaceRequest(sender) = request; let PipelineNamespaceRequest(sender) = request;
let _ = sender.send(self.next_pipeline_namespace_id()); let _ = sender.send(self.next_pipeline_namespace_id());
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request_from_background_hang_monitor(&self, message: HangMonitorAlert) { fn handle_request_from_background_hang_monitor(&self, message: HangMonitorAlert) {
match message { match message {
HangMonitorAlert::Profile(bytes) => self HangMonitorAlert::Profile(bytes) => self
@ -1312,7 +1312,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request_from_network_listener(&mut self, message: (PipelineId, FetchResponseMsg)) { fn handle_request_from_network_listener(&mut self, message: (PipelineId, FetchResponseMsg)) {
let (id, message_) = message; let (id, message_) = message;
let result = match self.pipelines.get(&id) { let result = match self.pipelines.get(&id) {
@ -1338,7 +1338,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request_from_compositor(&mut self, message: FromCompositorMsg) { fn handle_request_from_compositor(&mut self, message: FromCompositorMsg) {
trace_msg_from_compositor!(message, "{message:?}"); trace_msg_from_compositor!(message, "{message:?}");
match message { match message {
@ -1566,7 +1566,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request_from_script(&mut self, message: (PipelineId, FromScriptMsg)) { fn handle_request_from_script(&mut self, message: (PipelineId, FromScriptMsg)) {
let (source_pipeline_id, content) = message; let (source_pipeline_id, content) = message;
trace_script_msg!(content, "{source_pipeline_id}: {content:?}"); trace_script_msg!(content, "{source_pipeline_id}: {content:?}");
@ -1896,7 +1896,7 @@ where
} }
/// Broadcast a message via routers in various event-loops. /// Broadcast a message via routers in various event-loops.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_schedule_broadcast( fn handle_schedule_broadcast(
&self, &self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -1940,7 +1940,7 @@ where
} }
/// Remove a channel-name for a given broadcast router. /// Remove a channel-name for a given broadcast router.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_remove_broadcast_channel_name_in_router( fn handle_remove_broadcast_channel_name_in_router(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -1976,7 +1976,7 @@ where
} }
/// Note a new channel-name relevant to a given broadcast router. /// Note a new channel-name relevant to a given broadcast router.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_new_broadcast_channel_name_in_router( fn handle_new_broadcast_channel_name_in_router(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -1998,7 +1998,7 @@ where
} }
/// Remove a broadcast router. /// Remove a broadcast router.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_remove_broadcast_channel_router( fn handle_remove_broadcast_channel_router(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -2017,7 +2017,7 @@ where
} }
/// Add a new broadcast router. /// Add a new broadcast router.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_new_broadcast_channel_router( fn handle_new_broadcast_channel_router(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -2040,7 +2040,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_wgpu_request( fn handle_wgpu_request(
&mut self, &mut self,
source_pipeline_id: PipelineId, source_pipeline_id: PipelineId,
@ -2118,7 +2118,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_request_from_layout(&mut self, message: FromLayoutMsg) { fn handle_request_from_layout(&mut self, message: FromLayoutMsg) {
trace_layout_msg!(message, "{message:?}"); trace_layout_msg!(message, "{message:?}");
match message { match message {
@ -2133,7 +2133,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_message_port_transfer_completed( fn handle_message_port_transfer_completed(
&mut self, &mut self,
router_id: Option<MessagePortRouterId>, router_id: Option<MessagePortRouterId>,
@ -2272,7 +2272,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_complete_message_port_transfer( fn handle_complete_message_port_transfer(
&mut self, &mut self,
router_id: MessagePortRouterId, router_id: MessagePortRouterId,
@ -2353,7 +2353,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_reroute_messageport(&mut self, port_id: MessagePortId, task: PortMessageTask) { fn handle_reroute_messageport(&mut self, port_id: MessagePortId, task: PortMessageTask) {
let info = match self.message_ports.get_mut(&port_id) { let info = match self.message_ports.get_mut(&port_id) {
Some(info) => info, Some(info) => info,
@ -2385,7 +2385,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_messageport_shipped(&mut self, port_id: MessagePortId) { fn handle_messageport_shipped(&mut self, port_id: MessagePortId) {
if let Some(info) = self.message_ports.get_mut(&port_id) { if let Some(info) = self.message_ports.get_mut(&port_id) {
match info.state { match info.state {
@ -2440,7 +2440,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_remove_messageport(&mut self, port_id: MessagePortId) { fn handle_remove_messageport(&mut self, port_id: MessagePortId) {
let entangled = match self.message_ports.remove(&port_id) { let entangled = match self.message_ports.remove(&port_id) {
Some(info) => info.entangled_with, Some(info) => info.entangled_with,
@ -2488,7 +2488,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_entangle_messageports(&mut self, port1: MessagePortId, port2: MessagePortId) { fn handle_entangle_messageports(&mut self, port1: MessagePortId, port2: MessagePortId) {
if let Some(info) = self.message_ports.get_mut(&port1) { if let Some(info) = self.message_ports.get_mut(&port1) {
info.entangled_with = Some(port2); info.entangled_with = Some(port2);
@ -2514,7 +2514,7 @@ where
/// ///
/// The Job Queue is essentially the channel to a SW manager, /// The Job Queue is essentially the channel to a SW manager,
/// which are scoped per origin. /// which are scoped per origin.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_schedule_serviceworker_job(&mut self, pipeline_id: PipelineId, job: Job) { fn handle_schedule_serviceworker_job(&mut self, pipeline_id: PipelineId, job: Job) {
let origin = job.scope_url.origin(); let origin = job.scope_url.origin();
@ -2554,7 +2554,7 @@ where
let _ = sw_manager.send(ServiceWorkerMsg::ScheduleJob(job)); let _ = sw_manager.send(ServiceWorkerMsg::ScheduleJob(job));
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_broadcast_storage_event( fn handle_broadcast_storage_event(
&self, &self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -2585,7 +2585,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_exit(&mut self) { fn handle_exit(&mut self) {
debug!("Handling exit."); debug!("Handling exit.");
@ -2666,7 +2666,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_shutdown(&mut self) { fn handle_shutdown(&mut self) {
debug!("Handling shutdown."); debug!("Handling shutdown.");
@ -2791,7 +2791,7 @@ where
self.pipelines.remove(&pipeline_id); self.pipelines.remove(&pipeline_id);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_send_error(&mut self, pipeline_id: PipelineId, err: IpcError) { fn handle_send_error(&mut self, pipeline_id: PipelineId, err: IpcError) {
// Treat send error the same as receiving a panic message // Treat send error the same as receiving a panic message
error!("{}: Send error ({})", pipeline_id, err); error!("{}: Send error ({})", pipeline_id, err);
@ -2803,7 +2803,7 @@ where
self.handle_panic(top_level_browsing_context_id, reason, None); self.handle_panic(top_level_browsing_context_id, reason, None);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_panic( fn handle_panic(
&mut self, &mut self,
top_level_browsing_context_id: Option<TopLevelBrowsingContextId>, top_level_browsing_context_id: Option<TopLevelBrowsingContextId>,
@ -2901,7 +2901,7 @@ where
}); });
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_log_entry( fn handle_log_entry(
&mut self, &mut self,
top_level_browsing_context_id: Option<TopLevelBrowsingContextId>, top_level_browsing_context_id: Option<TopLevelBrowsingContextId>,
@ -2981,7 +2981,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_new_top_level_browsing_context( fn handle_new_top_level_browsing_context(
&mut self, &mut self,
url: ServoUrl, url: ServoUrl,
@ -3048,7 +3048,7 @@ where
}); });
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_close_top_level_browsing_context( fn handle_close_top_level_browsing_context(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -3095,7 +3095,7 @@ where
debug!("{top_level_browsing_context_id}: Closed"); debug!("{top_level_browsing_context_id}: Closed");
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_iframe_size_msg(&mut self, iframe_sizes: Vec<IFrameSizeMsg>) { fn handle_iframe_size_msg(&mut self, iframe_sizes: Vec<IFrameSizeMsg>) {
for IFrameSizeMsg { for IFrameSizeMsg {
browsing_context_id, browsing_context_id,
@ -3112,7 +3112,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_subframe_loaded(&mut self, pipeline_id: PipelineId) { fn handle_subframe_loaded(&mut self, pipeline_id: PipelineId) {
let browsing_context_id = match self.pipelines.get(&pipeline_id) { let browsing_context_id = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.browsing_context_id, Some(pipeline) => pipeline.browsing_context_id,
@ -3153,7 +3153,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_navigate_request( fn handle_navigate_request(
&self, &self,
id: PipelineId, id: PipelineId,
@ -3174,7 +3174,7 @@ where
// iframe via script. This will result in a new pipeline being spawned and // iframe via script. This will result in a new pipeline being spawned and
// a child being added to the parent browsing context. This message is never // a child being added to the parent browsing context. This message is never
// the result of a page navigation. // the result of a page navigation.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_script_loaded_url_in_iframe_msg(&mut self, load_info: IFrameLoadInfoWithData) { fn handle_script_loaded_url_in_iframe_msg(&mut self, load_info: IFrameLoadInfoWithData) {
let IFrameLoadInfo { let IFrameLoadInfo {
parent_pipeline_id, parent_pipeline_id,
@ -3281,7 +3281,7 @@ where
}); });
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_script_new_iframe(&mut self, load_info: IFrameLoadInfoWithData) { fn handle_script_new_iframe(&mut self, load_info: IFrameLoadInfoWithData) {
let IFrameLoadInfo { let IFrameLoadInfo {
parent_pipeline_id, parent_pipeline_id,
@ -3342,7 +3342,7 @@ where
}); });
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_script_new_auxiliary(&mut self, load_info: AuxiliaryBrowsingContextLoadInfo) { fn handle_script_new_auxiliary(&mut self, load_info: AuxiliaryBrowsingContextLoadInfo) {
let AuxiliaryBrowsingContextLoadInfo { let AuxiliaryBrowsingContextLoadInfo {
load_data, load_data,
@ -3428,19 +3428,19 @@ where
}); });
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_pending_paint_metric(&self, pipeline_id: PipelineId, epoch: Epoch) { fn handle_pending_paint_metric(&self, pipeline_id: PipelineId, epoch: Epoch) {
self.compositor_proxy self.compositor_proxy
.send(CompositorMsg::PendingPaintMetric(pipeline_id, epoch)) .send(CompositorMsg::PendingPaintMetric(pipeline_id, epoch))
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_set_cursor_msg(&mut self, cursor: Cursor) { fn handle_set_cursor_msg(&mut self, cursor: Cursor) {
self.embedder_proxy self.embedder_proxy
.send((None, EmbedderMsg::SetCursor(cursor))) .send((None, EmbedderMsg::SetCursor(cursor)))
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_change_running_animations_state( fn handle_change_running_animations_state(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -3458,7 +3458,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_tick_animation(&mut self, pipeline_id: PipelineId, tick_type: AnimationTickType) { fn handle_tick_animation(&mut self, pipeline_id: PipelineId, tick_type: AnimationTickType) {
let pipeline = match self.pipelines.get(&pipeline_id) { let pipeline = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline, Some(pipeline) => pipeline,
@ -3474,7 +3474,7 @@ where
/// Schedule a navigation(via load_url). /// Schedule a navigation(via load_url).
/// 1: Ask the embedder for permission. /// 1: Ask the embedder for permission.
/// 2: Store the details of the navigation, pending approval from the embedder. /// 2: Store the details of the navigation, pending approval from the embedder.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn schedule_navigation( fn schedule_navigation(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -3501,7 +3501,7 @@ where
self.embedder_proxy.send(msg); self.embedder_proxy.send(msg);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn load_url( fn load_url(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -3630,7 +3630,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_abort_load_url_msg(&mut self, new_pipeline_id: PipelineId) { fn handle_abort_load_url_msg(&mut self, new_pipeline_id: PipelineId) {
let pending_index = self let pending_index = self
.pending_changes .pending_changes
@ -3648,7 +3648,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_load_complete_msg( fn handle_load_complete_msg(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -3697,7 +3697,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_navigated_to_fragment( fn handle_navigated_to_fragment(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -3729,7 +3729,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_traverse_history_msg( fn handle_traverse_history_msg(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -3871,7 +3871,7 @@ where
self.update_webview_in_compositor(top_level_browsing_context_id); self.update_webview_in_compositor(top_level_browsing_context_id);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn update_browsing_context( fn update_browsing_context(
&mut self, &mut self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -3996,7 +3996,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn update_pipeline( fn update_pipeline(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -4023,7 +4023,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_joint_session_history_length( fn handle_joint_session_history_length(
&self, &self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -4037,7 +4037,7 @@ where
let _ = response_sender.send(length as u32); let _ = response_sender.send(length as u32);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_push_history_state_msg( fn handle_push_history_state_msg(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -4077,7 +4077,7 @@ where
self.notify_history_changed(top_level_browsing_context_id); self.notify_history_changed(top_level_browsing_context_id);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_replace_history_state_msg( fn handle_replace_history_state_msg(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -4102,7 +4102,7 @@ where
session_history.replace_history_state(pipeline_id, history_state_id, url); session_history.replace_history_state(pipeline_id, history_state_id, url);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_ime_dismissed(&mut self) { fn handle_ime_dismissed(&mut self) {
// Send to the focused browsing contexts' current pipeline. // Send to the focused browsing contexts' current pipeline.
let focused_browsing_context_id = self let focused_browsing_context_id = self
@ -4133,7 +4133,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_key_msg(&mut self, event: KeyboardEvent) { fn handle_key_msg(&mut self, event: KeyboardEvent) {
// Send to the focused browsing contexts' current pipeline. If it // Send to the focused browsing contexts' current pipeline. If it
// doesn't exist, fall back to sending to the compositor. // doesn't exist, fall back to sending to the compositor.
@ -4172,7 +4172,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_reload_msg(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) { fn handle_reload_msg(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id);
let pipeline_id = match self.browsing_contexts.get(&browsing_context_id) { let pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
@ -4191,7 +4191,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_post_message_msg( fn handle_post_message_msg(
&mut self, &mut self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -4230,7 +4230,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_get_pipeline( fn handle_get_pipeline(
&mut self, &mut self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -4252,7 +4252,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_get_browsing_context( fn handle_get_browsing_context(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -4267,7 +4267,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_focus_msg(&mut self, pipeline_id: PipelineId) { fn handle_focus_msg(&mut self, pipeline_id: PipelineId) {
let (browsing_context_id, top_level_browsing_context_id) = let (browsing_context_id, top_level_browsing_context_id) =
match self.pipelines.get(&pipeline_id) { match self.pipelines.get(&pipeline_id) {
@ -4302,7 +4302,7 @@ where
self.focus_parent_pipeline(browsing_context_id); self.focus_parent_pipeline(browsing_context_id);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn focus_parent_pipeline(&mut self, browsing_context_id: BrowsingContextId) { fn focus_parent_pipeline(&mut self, browsing_context_id: BrowsingContextId) {
let parent_pipeline_id = match self.browsing_contexts.get(&browsing_context_id) { let parent_pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
Some(ctx) => ctx.parent_pipeline_id, Some(ctx) => ctx.parent_pipeline_id,
@ -4333,7 +4333,7 @@ where
self.focus_parent_pipeline(parent_browsing_context_id); self.focus_parent_pipeline(parent_browsing_context_id);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_remove_iframe_msg( fn handle_remove_iframe_msg(
&mut self, &mut self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -4346,7 +4346,7 @@ where
result result
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_set_throttled_complete(&mut self, pipeline_id: PipelineId, throttled: bool) { fn handle_set_throttled_complete(&mut self, pipeline_id: PipelineId, throttled: bool) {
let browsing_context_id = match self.pipelines.get(&pipeline_id) { let browsing_context_id = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.browsing_context_id, Some(pipeline) => pipeline.browsing_context_id,
@ -4381,7 +4381,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_create_canvas_paint_thread_msg( fn handle_create_canvas_paint_thread_msg(
&mut self, &mut self,
size: UntypedSize2D<u64>, size: UntypedSize2D<u64>,
@ -4405,7 +4405,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_webdriver_msg(&mut self, msg: WebDriverCommandMsg) { fn handle_webdriver_msg(&mut self, msg: WebDriverCommandMsg) {
// Find the script channel for the given parent pipeline, // Find the script channel for the given parent pipeline,
// and pass the event to that script thread. // and pass the event to that script thread.
@ -4536,7 +4536,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn set_webview_throttled(&mut self, webview_id: WebViewId, throttled: bool) { fn set_webview_throttled(&mut self, webview_id: WebViewId, throttled: bool) {
let browsing_context_id = BrowsingContextId::from(webview_id); let browsing_context_id = BrowsingContextId::from(webview_id);
let pipeline_id = match self.browsing_contexts.get(&browsing_context_id) { let pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
@ -4551,7 +4551,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn notify_history_changed(&self, top_level_browsing_context_id: TopLevelBrowsingContextId) { fn notify_history_changed(&self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
// Send a flat projection of the history to embedder. // Send a flat projection of the history to embedder.
// The final vector is a concatenation of the LoadData of the past // The final vector is a concatenation of the LoadData of the past
@ -4668,7 +4668,7 @@ where
self.embedder_proxy.send(msg); self.embedder_proxy.send(msg);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn load_url_for_webdriver( fn load_url_for_webdriver(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -4696,7 +4696,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn change_session_history(&mut self, change: SessionHistoryChange) { fn change_session_history(&mut self, change: SessionHistoryChange) {
debug!( debug!(
"{}: Setting to {}", "{}: Setting to {}",
@ -4851,7 +4851,7 @@ where
self.update_webview_in_compositor(change.top_level_browsing_context_id); self.update_webview_in_compositor(change.top_level_browsing_context_id);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn focused_browsing_context_is_descendant_of( fn focused_browsing_context_is_descendant_of(
&self, &self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -4867,7 +4867,7 @@ where
}) })
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn trim_history(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) { fn trim_history(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
let pipelines_to_evict = { let pipelines_to_evict = {
let session_history = self.get_joint_session_history(top_level_browsing_context_id); let session_history = self.get_joint_session_history(top_level_browsing_context_id);
@ -4927,7 +4927,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_activate_document_msg(&mut self, pipeline_id: PipelineId) { fn handle_activate_document_msg(&mut self, pipeline_id: PipelineId) {
debug!("{}: Document ready to activate", pipeline_id); debug!("{}: Document ready to activate", pipeline_id);
@ -4973,7 +4973,7 @@ where
} }
/// Called when the window is resized. /// Called when the window is resized.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_window_size_msg( fn handle_window_size_msg(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -4996,7 +4996,7 @@ where
} }
/// Called when the window exits from fullscreen mode /// Called when the window exits from fullscreen mode
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_exit_fullscreen_msg( fn handle_exit_fullscreen_msg(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -5010,7 +5010,7 @@ where
/// to check if the output image is "stable" and can be written as a screenshot /// to check if the output image is "stable" and can be written as a screenshot
/// for reftests. /// for reftests.
/// Since this function is only used in reftests, we do not harden it against panic. /// Since this function is only used in reftests, we do not harden it against panic.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_is_ready_to_save_image( fn handle_is_ready_to_save_image(
&mut self, &mut self,
pipeline_states: HashMap<PipelineId, Epoch>, pipeline_states: HashMap<PipelineId, Epoch>,
@ -5094,7 +5094,7 @@ where
} }
/// Get the current activity of a pipeline. /// Get the current activity of a pipeline.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn get_activity(&self, pipeline_id: PipelineId) -> DocumentActivity { fn get_activity(&self, pipeline_id: PipelineId) -> DocumentActivity {
let mut ancestor_id = pipeline_id; let mut ancestor_id = pipeline_id;
loop { loop {
@ -5121,7 +5121,7 @@ where
} }
/// Set the current activity of a pipeline. /// Set the current activity of a pipeline.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn set_activity(&self, pipeline_id: PipelineId, activity: DocumentActivity) { fn set_activity(&self, pipeline_id: PipelineId, activity: DocumentActivity) {
debug!("{}: Setting activity to {:?}", pipeline_id, activity); debug!("{}: Setting activity to {:?}", pipeline_id, activity);
if let Some(pipeline) = self.pipelines.get(&pipeline_id) { if let Some(pipeline) = self.pipelines.get(&pipeline_id) {
@ -5140,14 +5140,14 @@ where
} }
/// Update the current activity of a pipeline. /// Update the current activity of a pipeline.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn update_activity(&self, pipeline_id: PipelineId) { fn update_activity(&self, pipeline_id: PipelineId) {
self.set_activity(pipeline_id, self.get_activity(pipeline_id)); self.set_activity(pipeline_id, self.get_activity(pipeline_id));
} }
/// Handle updating the size of a browsing context. /// Handle updating the size of a browsing context.
/// This notifies every pipeline in the context of the new size. /// This notifies every pipeline in the context of the new size.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn resize_browsing_context( fn resize_browsing_context(
&mut self, &mut self,
new_size: WindowSizeData, new_size: WindowSizeData,
@ -5204,7 +5204,7 @@ where
} }
// Handle switching from fullscreen mode // Handle switching from fullscreen mode
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn switch_fullscreen_mode(&mut self, browsing_context_id: BrowsingContextId) { fn switch_fullscreen_mode(&mut self, browsing_context_id: BrowsingContextId) {
if let Some(browsing_context) = self.browsing_contexts.get(&browsing_context_id) { if let Some(browsing_context) = self.browsing_contexts.get(&browsing_context_id) {
let pipeline_id = browsing_context.pipeline_id; let pipeline_id = browsing_context.pipeline_id;
@ -5224,7 +5224,7 @@ where
} }
// Close and return the browsing context with the given id (and its children), if it exists. // Close and return the browsing context with the given id (and its children), if it exists.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn close_browsing_context( fn close_browsing_context(
&mut self, &mut self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -5264,7 +5264,7 @@ where
} }
// Close the children of a browsing context // Close the children of a browsing context
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn close_browsing_context_children( fn close_browsing_context_children(
&mut self, &mut self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -5295,7 +5295,7 @@ where
} }
// Discard the pipeline for a given document, udpdate the joint session history. // Discard the pipeline for a given document, udpdate the joint session history.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_discard_document( fn handle_discard_document(
&mut self, &mut self,
top_level_browsing_context_id: TopLevelBrowsingContextId, top_level_browsing_context_id: TopLevelBrowsingContextId,
@ -5327,7 +5327,7 @@ where
} }
// Send a message to script requesting the document associated with this pipeline runs the 'unload' algorithm. // Send a message to script requesting the document associated with this pipeline runs the 'unload' algorithm.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn unload_document(&self, pipeline_id: PipelineId) { fn unload_document(&self, pipeline_id: PipelineId) {
if let Some(pipeline) = self.pipelines.get(&pipeline_id) { if let Some(pipeline) = self.pipelines.get(&pipeline_id) {
let msg = ConstellationControlMsg::UnloadDocument(pipeline_id); let msg = ConstellationControlMsg::UnloadDocument(pipeline_id);
@ -5336,7 +5336,7 @@ where
} }
// Close all pipelines at and beneath a given browsing context // Close all pipelines at and beneath a given browsing context
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn close_pipeline( fn close_pipeline(
&mut self, &mut self,
pipeline_id: PipelineId, pipeline_id: PipelineId,
@ -5400,7 +5400,7 @@ where
} }
// Randomly close a pipeline -if --random-pipeline-closure-probability is set // Randomly close a pipeline -if --random-pipeline-closure-probability is set
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn maybe_close_random_pipeline(&mut self) { fn maybe_close_random_pipeline(&mut self) {
match self.random_pipeline_closure { match self.random_pipeline_closure {
Some((ref mut rng, probability)) => { Some((ref mut rng, probability)) => {
@ -5438,7 +5438,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn get_joint_session_history( fn get_joint_session_history(
&mut self, &mut self,
top_level_id: TopLevelBrowsingContextId, top_level_id: TopLevelBrowsingContextId,
@ -5450,7 +5450,7 @@ where
} }
// Convert a browsing context to a sendable form to pass to the compositor // Convert a browsing context to a sendable form to pass to the compositor
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn browsing_context_to_sendable( fn browsing_context_to_sendable(
&self, &self,
browsing_context_id: BrowsingContextId, browsing_context_id: BrowsingContextId,
@ -5480,7 +5480,7 @@ where
} }
/// Send the frame tree for the given webview to the compositor. /// Send the frame tree for the given webview to the compositor.
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn update_webview_in_compositor(&mut self, webview_id: WebViewId) { fn update_webview_in_compositor(&mut self, webview_id: WebViewId) {
// Note that this function can panic, due to ipc-channel creation failure. // Note that this function can panic, due to ipc-channel creation failure.
// avoiding this panic would require a mechanism for dealing // avoiding this panic would require a mechanism for dealing
@ -5493,7 +5493,7 @@ where
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_media_session_action_msg(&mut self, action: MediaSessionActionType) { fn handle_media_session_action_msg(&mut self, action: MediaSessionActionType) {
if let Some(media_session_pipeline_id) = self.active_media_session { if let Some(media_session_pipeline_id) = self.active_media_session {
let result = match self.pipelines.get(&media_session_pipeline_id) { let result = match self.pipelines.get(&media_session_pipeline_id) {
@ -5520,7 +5520,7 @@ where
} }
/// Handle GamepadEvents from the embedder and forward them to the script thread /// Handle GamepadEvents from the embedder and forward them to the script thread
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn handle_gamepad_msg(&mut self, event: GamepadEvent) { fn handle_gamepad_msg(&mut self, event: GamepadEvent) {
// Send to the focused browsing contexts' current pipeline. // Send to the focused browsing contexts' current pipeline.
let focused_browsing_context_id = self let focused_browsing_context_id = self

View file

@ -25,7 +25,7 @@ use style::values::computed::font::{
use style::values::computed::{FontStretch, FontWeight}; use style::values::computed::{FontStretch, FontWeight};
use style::values::specified::FontStretch as SpecifiedFontStretch; use style::values::specified::FontStretch as SpecifiedFontStretch;
use style::Atom; use style::Atom;
use tracing::{span, Level}; use tracing::{instrument, span, Level};
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey}; use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey};
use webrender_traits::WebRenderFontApi; use webrender_traits::WebRenderFontApi;
@ -156,7 +156,7 @@ impl SystemFontService {
SystemFontServiceProxySender(sender) SystemFontServiceProxySender(sender)
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn run(&mut self) { fn run(&mut self) {
loop { loop {
let msg = self.port.recv().unwrap(); let msg = self.port.recv().unwrap();
@ -196,7 +196,7 @@ impl SystemFontService {
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn fetch_new_keys(&mut self) { fn fetch_new_keys(&mut self) {
if !self.free_font_keys.is_empty() && !self.free_font_instance_keys.is_empty() { if !self.free_font_keys.is_empty() && !self.free_font_instance_keys.is_empty() {
return; return;
@ -213,7 +213,7 @@ impl SystemFontService {
.append(&mut new_font_instance_keys); .append(&mut new_font_instance_keys);
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn get_font_templates( fn get_font_templates(
&mut self, &mut self,
font_descriptor: Option<FontDescriptor>, font_descriptor: Option<FontDescriptor>,
@ -246,7 +246,7 @@ impl SystemFontService {
} }
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn refresh_local_families(&mut self) { fn refresh_local_families(&mut self) {
self.local_families.clear(); self.local_families.clear();
for_each_available_family(|family_name| { for_each_available_family(|family_name| {
@ -257,7 +257,7 @@ impl SystemFontService {
}); });
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn find_font_templates( fn find_font_templates(
&mut self, &mut self,
descriptor_to_match: Option<&FontDescriptor>, descriptor_to_match: Option<&FontDescriptor>,
@ -281,7 +281,7 @@ impl SystemFontService {
.unwrap_or_default() .unwrap_or_default()
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn get_font_instance( fn get_font_instance(
&mut self, &mut self,
identifier: FontIdentifier, identifier: FontIdentifier,

View file

@ -45,6 +45,7 @@ servo_config = { path = "../config" }
servo_geometry = { path = "../geometry" } servo_geometry = { path = "../geometry" }
servo_url = { path = "../url" } servo_url = { path = "../url" }
style = { workspace = true } style = { workspace = true }
tracing = { workspace = true }
style_traits = { workspace = true } style_traits = { workspace = true }
unicode-bidi = { workspace = true } unicode-bidi = { workspace = true }
unicode-script = { workspace = true } unicode-script = { workspace = true }

View file

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

View file

@ -24,6 +24,7 @@ use style::values::computed::{
use style::values::generics::box_::{GenericVerticalAlign as VerticalAlign, VerticalAlignKeyword}; use style::values::generics::box_::{GenericVerticalAlign as VerticalAlign, VerticalAlignKeyword};
use style::values::generics::length::GenericLengthPercentageOrAuto::{Auto, LengthPercentage}; use style::values::generics::length::GenericLengthPercentageOrAuto::{Auto, LengthPercentage};
use style::Zero; use style::Zero;
use tracing::instrument;
use super::{Table, TableCaption, TableSlot, TableSlotCell, TableTrack, TableTrackGroup}; use super::{Table, TableCaption, TableSlot, TableSlotCell, TableTrack, TableTrackGroup};
use crate::context::LayoutContext; use crate::context::LayoutContext;
@ -1630,6 +1631,7 @@ impl<'a> TableLayout<'a> {
/// Lay out the table (grid and captions) of this [`TableLayout`] into fragments. This should /// Lay out the table (grid and captions) of this [`TableLayout`] into fragments. This should
/// only be be called after calling [`TableLayout.compute_measures`]. /// only be be called after calling [`TableLayout.compute_measures`].
#[instrument(name = "Table::layout", skip_all, fields(servo_profiling = true))]
fn layout( fn layout(
mut self, mut self,
layout_context: &LayoutContext, layout_context: &LayoutContext,
@ -2601,6 +2603,11 @@ impl Table {
} }
} }
#[instrument(
name = "Table::inline_content_sizes",
skip_all,
fields(servo_profiling = true)
)]
pub(crate) fn inline_content_sizes( pub(crate) fn inline_content_sizes(
&mut self, &mut self,
layout_context: &LayoutContext, layout_context: &LayoutContext,

View file

@ -88,7 +88,7 @@ use style::values::computed::{CSSPixelLength, FontSize, Length, NonNegativeLengt
use style::values::specified::font::KeywordInfo; use style::values::specified::font::KeywordInfo;
use style::{driver, Zero}; use style::{driver, Zero};
use style_traits::{CSSPixel, DevicePixel, SpeculativePainter}; use style_traits::{CSSPixel, DevicePixel, SpeculativePainter};
use tracing::{span, Level}; use tracing::{instrument, span, Level};
use url::Url; use url::Url;
use webrender_api::units::LayoutPixel; use webrender_api::units::LayoutPixel;
use webrender_api::{units, ExternalScrollId, HitTestFlags}; 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( fn add_stylesheet(
&mut self, &mut self,
stylesheet: ServoArc<Stylesheet>, 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>) { fn remove_stylesheet(&mut self, stylesheet: ServoArc<Stylesheet>) {
let guard = stylesheet.shared_lock.read(); let guard = stylesheet.shared_lock.read();
let stylesheet = DocumentStyleSheet(stylesheet.clone()); let stylesheet = DocumentStyleSheet(stylesheet.clone());
@ -283,22 +283,22 @@ impl Layout for LayoutThread {
.remove_all_web_fonts_from_stylesheet(&stylesheet); .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>> { fn query_content_box(&self, node: OpaqueNode) -> Option<UntypedRect<Au>> {
process_content_box_request(node, self.fragment_tree.borrow().clone()) 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>> { fn query_content_boxes(&self, node: OpaqueNode) -> Vec<UntypedRect<Au>> {
process_content_boxes_request(node, self.fragment_tree.borrow().clone()) 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> { fn query_client_rect(&self, node: OpaqueNode) -> UntypedRect<i32> {
process_node_geometry_request(node, self.fragment_tree.borrow().clone()) 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( fn query_element_inner_outer_text(
&self, &self,
node: script_layout_interface::TrustedNodeAddress, node: script_layout_interface::TrustedNodeAddress,
@ -316,7 +316,7 @@ impl Layout for LayoutThread {
None None
} }
#[tracing::instrument(skip(self), fields(servo_profiling = true))] #[instrument(skip_all, fields(servo_profiling = true))]
fn query_nodes_from_point( fn query_nodes_from_point(
&self, &self,
point: UntypedPoint2D<f32>, point: UntypedPoint2D<f32>,
@ -339,12 +339,12 @@ impl Layout for LayoutThread {
results.iter().map(|result| result.node.into()).collect() 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 { fn query_offset_parent(&self, node: OpaqueNode) -> OffsetParentResponse {
process_offset_parent_query(node, self.fragment_tree.borrow().clone()) 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( fn query_resolved_style(
&self, &self,
node: TrustedNodeAddress, 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( fn query_resolved_font_style(
&self, &self,
node: TrustedNodeAddress, 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> { fn query_scrolling_area(&self, node: Option<OpaqueNode>) -> UntypedRect<i32> {
process_node_scroll_area_request(node, self.fragment_tree.borrow().clone()) 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( fn query_text_indext(
&self, &self,
node: OpaqueNode, node: OpaqueNode,
@ -663,7 +663,7 @@ impl LayoutThread {
} }
/// The high-level routine that performs layout. /// 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) { fn handle_reflow(&mut self, data: &mut ScriptReflowResult) {
let document = unsafe { ServoLayoutNode::new(&data.document) }; let document = unsafe { ServoLayoutNode::new(&data.document) };
let document = document.as_document().unwrap(); let document = document.as_document().unwrap();