From b170a45bd93db2c0100cf1ffea41204d9bf82b81 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Thu, 29 Sep 2022 21:26:46 +0000 Subject: [PATCH] Pull present_to_present_delta. This new field allows to detect rendering instability. Bug: 239083860 Test: manual Change-Id: I0da91132cf7a6c41e89a138244d79ab1834e8269 --- services/core/jni/stats/SurfaceFlingerPuller.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/core/jni/stats/SurfaceFlingerPuller.cpp b/services/core/jni/stats/SurfaceFlingerPuller.cpp index 88736732a61c7..b959798d09692 100644 --- a/services/core/jni/stats/SurfaceFlingerPuller.cpp +++ b/services/core/jni/stats/SurfaceFlingerPuller.cpp @@ -122,9 +122,12 @@ AStatsManager_PullAtomCallbackReturn SurfaceFlingerPuller::parseLayerInfoPull( for (const auto& atom : atomList.atom()) { // The strings must outlive the BytesFields, which only have a pointer to the data. std::string present2PresentStr, post2presentStr, acquire2PresentStr, latch2PresentStr, - desired2PresentStr, post2AcquireStr, frameRateVoteStr, appDeadlineMissesStr; + desired2PresentStr, post2AcquireStr, frameRateVoteStr, appDeadlineMissesStr, + present2PresentDeltaStr; optional present2Present = getBytes(atom.present_to_present(), present2PresentStr); + optional present2PresentDelta = + getBytes(atom.present_to_present_delta(), present2PresentDeltaStr); optional post2present = getBytes(atom.post_to_present(), post2presentStr); optional acquire2Present = getBytes(atom.acquire_to_present(), acquire2PresentStr); @@ -138,7 +141,8 @@ AStatsManager_PullAtomCallbackReturn SurfaceFlingerPuller::parseLayerInfoPull( // Fail if any serialization to bytes failed. if (!present2Present || !post2present || !acquire2Present || !latch2Present || - !desired2Present || !post2Acquire || !frameRateVote || !appDeadlineMisses) { + !desired2Present || !post2Acquire || !frameRateVote || !appDeadlineMisses || + !present2PresentDelta) { return AStatsManager_PULL_SKIP; } @@ -159,7 +163,7 @@ AStatsManager_PullAtomCallbackReturn SurfaceFlingerPuller::parseLayerInfoPull( atom.total_jank_frames_app_buffer_stuffing(), atom.display_refresh_rate_bucket(), atom.render_rate_bucket(), frameRateVote.value(), appDeadlineMisses.value(), - atom.game_mode()); + atom.game_mode(), present2PresentDelta.value()); } return AStatsManager_PULL_SUCCESS; }