summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pascal Mütschard <pmuetschard@google.com> 2023-01-23 12:37:14 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-01-23 12:37:14 +0000
commit5ff61b8742451ec45e358676d429f01d698e15dd (patch)
treeba810ed78dfd4d784dfd1dc4bfc8b411d34846c7
parent492cf57ab68bdcedb6f3985433183cb5ed15e697 (diff)
parent556262611b959b9db25c63551d385aeef304cd22 (diff)
Merge "Track jank classification for bufferless layers."
-rw-r--r--services/surfaceflinger/Layer.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 0179d62f08..b519bd2ad1 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2662,18 +2662,18 @@ void Layer::onLayerDisplayed(ftl::SharedFuture<FenceResult> futureFenceResult) {
void Layer::onSurfaceFrameCreated(
const std::shared_ptr<frametimeline::SurfaceFrame>& surfaceFrame) {
- if (!hasBufferOrSidebandStreamInDrawing()) {
- return;
- }
-
while (mPendingJankClassifications.size() >= kPendingClassificationMaxSurfaceFrames) {
// Too many SurfaceFrames pending classification. The front of the deque is probably not
// tracked by FrameTimeline and will never be presented. This will only result in a memory
// leak.
- ALOGW("Removing the front of pending jank deque from layer - %s to prevent memory leak",
- mName.c_str());
- std::string miniDump = mPendingJankClassifications.front()->miniDump();
- ALOGD("Head SurfaceFrame mini dump\n%s", miniDump.c_str());
+ if (hasBufferOrSidebandStreamInDrawing()) {
+ // Only log for layers with a buffer, since we expect the jank data to be drained for
+ // these, while there may be no jank listeners for bufferless layers.
+ ALOGW("Removing the front of pending jank deque from layer - %s to prevent memory leak",
+ mName.c_str());
+ std::string miniDump = mPendingJankClassifications.front()->miniDump();
+ ALOGD("Head SurfaceFrame mini dump\n%s", miniDump.c_str());
+ }
mPendingJankClassifications.pop_front();
}
mPendingJankClassifications.emplace_back(surfaceFrame);