From c4def15ae32be3949d3cf40a4314c165c6be76f5 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Thu, 26 Sep 2019 15:20:00 +0200 Subject: [DO NOT MERGE] Log Winscope tracing with the frame composition time Currently the tracing log takes the current timestamp for the log entry. However, the tracing start after the frame is composed. On winscope this result in the trace entry being linked to the incorrect video frame (screenrecord). Now we obtain the frame composition time (before the frame is send to the video recorder) and use this time for the log entry. Test: Log a SF trace and screen recording. Open both on winscope. Change-Id: I81a88ef7a81a084f2ecf75bf5574a1118301a48e --- services/surfaceflinger/SurfaceFlinger.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 3057ed13e7..cb6dd8b9eb 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1808,6 +1808,7 @@ void SurfaceFlinger::handleMessageRefresh() { preComposition(); rebuildLayerStacks(); calculateWorkingSet(); + long compositionTime = elapsedRealtimeNano(); for (const auto& [token, display] : mDisplays) { beginFrame(display); prepareFrame(display); @@ -1837,7 +1838,7 @@ void SurfaceFlinger::handleMessageRefresh() { if (mVisibleRegionsDirty) { mVisibleRegionsDirty = false; if (mTracingEnabled) { - mTracing.notify("visibleRegionsDirty"); + mTracing.notify(compositionTime, "visibleRegionsDirty"); } } } -- cgit v1.2.3-59-g8ed1b