mirror of
https://github.com/servo/servo.git
synced 2025-10-01 17:19:16 +01:00
compositor: Add Paint Metric events to Perfetto Traces (#39502)
> Some metrics like TimeToFirstPaint and TimeToFirstContentfulPaint are only in the HTML traces. [See this](https://github.com/servo/perf-analysis-tools?tab=readme-ov-file#how-to-analyse-a-single-servo-sample) In order to analyse the performance and refine [perf-analysis-tools](https://github.com/servo/perf-analysis-tools) we need these metrics to be added to Perfetto also. <img width="993" height="359" alt="Screenshot from 2025-09-26 15-00-00" src="https://github.com/user-attachments/assets/9755f344-a98e-4671-b347-d76cd6311afe" /> <img width="1186" height="359" alt="Screenshot from 2025-09-26 15-00-42" src="https://github.com/user-attachments/assets/a25e3a5f-eef0-45b7-be69-5de919bfb663" /> Testing: Verified by using Perfetto traces Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
This commit is contained in:
parent
0c22f784bb
commit
6995e60ee1
1 changed files with 16 additions and 0 deletions
|
@ -1383,6 +1383,14 @@ impl IOCompositor {
|
|||
// the first "real" display list.
|
||||
PaintMetricState::Seen(epoch, first_reflow) if epoch <= current_epoch => {
|
||||
assert!(epoch <= current_epoch);
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!(
|
||||
name: "FirstPaint",
|
||||
servo_profiling = true,
|
||||
epoch = ?epoch,
|
||||
paint_time = ?paint_time,
|
||||
pipeline_id = ?pipeline_id,
|
||||
);
|
||||
if let Err(error) = self.global.borrow().constellation_sender.send(
|
||||
EmbedderToConstellationMessage::PaintMetric(
|
||||
*pipeline_id,
|
||||
|
@ -1400,6 +1408,14 @@ impl IOCompositor {
|
|||
|
||||
match pipeline.first_contentful_paint_metric {
|
||||
PaintMetricState::Seen(epoch, first_reflow) if epoch <= current_epoch => {
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!(
|
||||
name: "FirstContentfulPaint",
|
||||
servo_profiling = true,
|
||||
epoch = ?epoch,
|
||||
paint_time = ?paint_time,
|
||||
pipeline_id = ?pipeline_id,
|
||||
);
|
||||
if let Err(error) = self.global.borrow().constellation_sender.send(
|
||||
EmbedderToConstellationMessage::PaintMetric(
|
||||
*pipeline_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue