mirror of
https://github.com/servo/servo.git
synced 2025-07-29 10:10:34 +01:00
Plumb time profiler output into tracing (#34238)
* Plumb time profiler output into tracing Signed-off-by: Delan Azabani <dazabani@igalia.com> * Enter the span tightly around the callback Signed-off-by: Delan Azabani <dazabani@igalia.com> * Use `info_span!()` shorthand Signed-off-by: Delan Azabani <dazabani@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
495cceb7de
commit
aa7116c75d
16 changed files with 279 additions and 82 deletions
|
@ -11,6 +11,9 @@ rust-version.workspace = true
|
|||
name = "layout_thread_2013"
|
||||
path = "lib.rs"
|
||||
|
||||
[features]
|
||||
tracing = ["dep:tracing", "layout/tracing"]
|
||||
|
||||
[dependencies]
|
||||
app_units = { workspace = true }
|
||||
base = { workspace = true }
|
||||
|
@ -42,6 +45,7 @@ servo_url = { path = "../url" }
|
|||
style = { workspace = true }
|
||||
style_traits = { workspace = true }
|
||||
time_03 = { workspace = true }
|
||||
tracing = { workspace = true, optional = true }
|
||||
url = { workspace = true }
|
||||
webrender_api = { workspace = true }
|
||||
webrender_traits = { workspace = true }
|
||||
|
|
|
@ -55,10 +55,10 @@ use net_traits::image_cache::{ImageCache, UsePlaceholder};
|
|||
use net_traits::ResourceThreads;
|
||||
use parking_lot::RwLock;
|
||||
use profile_traits::mem::{Report, ReportKind};
|
||||
use profile_traits::path;
|
||||
use profile_traits::time::{
|
||||
self as profile_time, profile, TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType,
|
||||
self as profile_time, TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType,
|
||||
};
|
||||
use profile_traits::{path, time_profile};
|
||||
use script::layout_dom::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNode};
|
||||
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||
use script_layout_interface::{
|
||||
|
@ -528,7 +528,7 @@ impl Layout for LayoutThread {
|
|||
|
||||
fn reflow(&mut self, script_reflow: script_layout_interface::ScriptReflow) {
|
||||
let mut result = ScriptReflowResult::new(script_reflow);
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutPerform,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -838,7 +838,7 @@ impl LayoutThread {
|
|||
) {
|
||||
let writing_mode = layout_root.base().writing_mode;
|
||||
let (metadata, sender) = (self.profiler_metadata(), self.time_profiler_chan.clone());
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutDispListBuild,
|
||||
metadata.clone(),
|
||||
sender.clone(),
|
||||
|
@ -1103,7 +1103,7 @@ impl LayoutThread {
|
|||
|
||||
if token.should_traverse() {
|
||||
// Recalculate CSS styles and rebuild flows and fragments.
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutStyleRecalc,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -1248,7 +1248,7 @@ impl LayoutThread {
|
|||
FlowRef::deref_mut(root_flow),
|
||||
);
|
||||
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutRestyleDamagePropagation,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -1270,7 +1270,7 @@ impl LayoutThread {
|
|||
}
|
||||
|
||||
// Resolve generated content.
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutGeneratedContent,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -1278,7 +1278,7 @@ impl LayoutThread {
|
|||
);
|
||||
|
||||
// Guess float placement.
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutFloatPlacementSpeculation,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -1292,7 +1292,7 @@ impl LayoutThread {
|
|||
.restyle_damage
|
||||
.intersects(ServoRestyleDamage::REFLOW | ServoRestyleDamage::REFLOW_OUT_OF_FLOW)
|
||||
{
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutMain,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -1316,7 +1316,7 @@ impl LayoutThread {
|
|||
);
|
||||
}
|
||||
|
||||
profile(
|
||||
time_profile!(
|
||||
profile_time::ProfilerCategory::LayoutStoreOverflow,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue