Commit 852c66f8 authored by Fady Samuel's avatar Fady Samuel Committed by Commit Bot

Surface Synchronization: Make Submission Flow Trace Less Noisy

Only log an event if the LocalSurfaceId has changed instead of on
every submit and receipt of CompositorFrames.

Bug: 672962
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4814ec0aaa9c204864d5c5df0c4a359d4ef3bb28
Reviewed-on: https://chromium-review.googlesource.com/1134027
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarSaman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574409}
parent 59774f86
...@@ -152,16 +152,18 @@ void AsyncLayerTreeFrameSink::SubmitCompositorFrame( ...@@ -152,16 +152,18 @@ void AsyncLayerTreeFrameSink::SubmitCompositorFrame(
else else
hit_test_region_list = client_->BuildHitTestData(); hit_test_region_list = client_->BuildHitTestData();
last_submitted_local_surface_id_ = local_surface_id_; if (last_submitted_local_surface_id_ != local_surface_id_) {
last_submitted_device_scale_factor_ = frame.device_scale_factor(); last_submitted_local_surface_id_ = local_surface_id_;
last_submitted_size_in_pixels_ = frame.size_in_pixels(); last_submitted_device_scale_factor_ = frame.device_scale_factor();
last_submitted_size_in_pixels_ = frame.size_in_pixels();
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"), TRACE_EVENT_WITH_FLOW2(
"LocalSurfaceId.Submission.Flow", TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
TRACE_ID_GLOBAL(local_surface_id_.submission_trace_id()), "LocalSurfaceId.Submission.Flow",
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step", TRACE_ID_GLOBAL(local_surface_id_.submission_trace_id()),
"SubmitCompositorFrame", "surface_id", local_surface_id_.ToString()); TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"SubmitCompositorFrame", "surface_id", local_surface_id_.ToString());
}
compositor_frame_sink_ptr_->SubmitCompositorFrame( compositor_frame_sink_ptr_->SubmitCompositorFrame(
local_surface_id_, std::move(frame), std::move(hit_test_region_list), local_surface_id_, std::move(frame), std::move(hit_test_region_list),
......
...@@ -1217,7 +1217,7 @@ void LayerTreeHost::SetLocalSurfaceIdFromParent( ...@@ -1217,7 +1217,7 @@ void LayerTreeHost::SetLocalSurfaceIdFromParent(
"LocalSurfaceId.Submission.Flow", "LocalSurfaceId.Submission.Flow",
TRACE_ID_GLOBAL(local_surface_id_from_parent.submission_trace_id()), TRACE_ID_GLOBAL(local_surface_id_from_parent.submission_trace_id()),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step", TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"SetLocalSurfaceIdFromParent", "surface_id", "SetLocalSurfaceIdFromParent", "local_surface_id",
local_surface_id_from_parent.ToString()); local_surface_id_from_parent.ToString());
local_surface_id_from_parent_ = local_surface_id_from_parent; local_surface_id_from_parent_ = local_surface_id_from_parent;
has_pushed_local_surface_id_from_parent_ = false; has_pushed_local_surface_id_from_parent_ = false;
......
...@@ -49,24 +49,25 @@ void ParentLocalSurfaceIdAllocator::Invalidate() { ...@@ -49,24 +49,25 @@ void ParentLocalSurfaceIdAllocator::Invalidate() {
} }
const LocalSurfaceId& ParentLocalSurfaceIdAllocator::GenerateId() { const LocalSurfaceId& ParentLocalSurfaceIdAllocator::GenerateId() {
if (!is_allocation_suppressed_) if (!is_allocation_suppressed_) {
++current_local_surface_id_.parent_sequence_number_; ++current_local_surface_id_.parent_sequence_number_;
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Embed.Flow",
TRACE_ID_GLOBAL(current_local_surface_id_.embed_trace_id()),
TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ParentLocalSurfaceIdAllocator::GenerateId", "local_surface_id",
current_local_surface_id_.ToString());
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Submission.Flow",
TRACE_ID_GLOBAL(current_local_surface_id_.submission_trace_id()),
TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ParentLocalSurfaceIdAllocator::GenerateId", "local_surface_id",
current_local_surface_id_.ToString());
}
is_invalid_ = false; is_invalid_ = false;
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Embed.Flow",
TRACE_ID_GLOBAL(current_local_surface_id_.embed_trace_id()),
TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ParentLocalSurfaceIdAllocator::GenerateId", "local_surface_id",
current_local_surface_id_.ToString());
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Submission.Flow",
TRACE_ID_GLOBAL(current_local_surface_id_.submission_trace_id()),
TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ParentLocalSurfaceIdAllocator::GenerateId", "local_surface_id",
current_local_surface_id_.ToString());
return current_local_surface_id_; return current_local_surface_id_;
} }
......
...@@ -308,14 +308,6 @@ CompositorFrameSinkSupport::MaybeSubmitCompositorFrame( ...@@ -308,14 +308,6 @@ CompositorFrameSinkSupport::MaybeSubmitCompositorFrame(
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step", TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ReceiveCompositorFrame"); "ReceiveCompositorFrame");
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Submission.Flow",
TRACE_ID_GLOBAL(local_surface_id.submission_trace_id()),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ReceiveCompositorFrame", "local_surface_id",
local_surface_id.ToString());
TRACE_EVENT_FLOW_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"), TRACE_EVENT_FLOW_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"),
"SubmitCompositorFrame", local_surface_id.hash()); "SubmitCompositorFrame", local_surface_id.hash());
...@@ -385,6 +377,14 @@ CompositorFrameSinkSupport::MaybeSubmitCompositorFrame( ...@@ -385,6 +377,14 @@ CompositorFrameSinkSupport::MaybeSubmitCompositorFrame(
local_surface_id == last_created_surface_id_.local_surface_id()) { local_surface_id == last_created_surface_id_.local_surface_id()) {
current_surface = prev_surface; current_surface = prev_surface;
} else { } else {
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Submission.Flow",
TRACE_ID_GLOBAL(local_surface_id.submission_trace_id()),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"ReceiveCompositorFrame", "local_surface_id",
local_surface_id.ToString());
SurfaceId surface_id(frame_sink_id_, local_surface_id); SurfaceId surface_id(frame_sink_id_, local_surface_id);
SurfaceInfo surface_info(surface_id, frame.device_scale_factor(), SurfaceInfo surface_info(surface_id, frame.device_scale_factor(),
frame.size_in_pixels()); frame.size_in_pixels());
......
...@@ -408,6 +408,14 @@ FrameDeadline Surface::UpdateActivationDependencies( ...@@ -408,6 +408,14 @@ FrameDeadline Surface::UpdateActivationDependencies(
if (!track_dependencies) if (!track_dependencies)
continue; continue;
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"LocalSurfaceId.Embed.Flow",
TRACE_ID_GLOBAL(surface_id.local_surface_id().embed_trace_id()),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"AddedActivationDependency", "child_surface_id",
surface_id.ToString());
// Record the latest |parent_sequence_number| this surface is interested // Record the latest |parent_sequence_number| this surface is interested
// in observing for the provided FrameSinkId. // in observing for the provided FrameSinkId.
uint32_t& parent_sequence_number = uint32_t& parent_sequence_number =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment