Expand jank classification
This change expands the jank classification to include new cases like
BufferStuffing and SurfaceFlingerScheduling while also updating the jank
classification logic to be more accurate.
This change also refactors SurfaceFrame by removing the abstraction
class for SurfaceFrame since its now being polled by the layers as well.
Bug: 169890654
Test: libsurfaceflinger_unittest
Change-Id: Ica8ab1d1e4bf2052fffc6247fc5820d96ae8445d
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6f86e76..2c16411 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -339,7 +339,7 @@
mInterceptor(mFactory.createSurfaceInterceptor()),
mTimeStats(std::make_shared<impl::TimeStats>()),
mFrameTracer(mFactory.createFrameTracer()),
- mFrameTimeline(mFactory.createFrameTimeline(mTimeStats)),
+ mFrameTimeline(mFactory.createFrameTimeline(mTimeStats, getpid())),
mEventQueue(mFactory.createMessageQueue()),
mCompositionEngine(mFactory.createCompositionEngine()),
mInternalDisplayDensity(getDensityFromProperty("ro.sf.lcd_density", true)),
@@ -1872,7 +1872,7 @@
const bool tracePreComposition = mTracingEnabled && !mTracePostComposition;
ConditionalLockGuard<std::mutex> lock(mTracingLock, tracePreComposition);
- mFrameTimeline->setSfWakeUp(vsyncId, frameStart);
+ mFrameTimeline->setSfWakeUp(vsyncId, frameStart, stats.vsyncPeriod);
refreshNeeded = handleMessageTransaction();
refreshNeeded |= handleMessageInvalidate();
@@ -5360,8 +5360,8 @@
const auto refreshRate = data.readFloat();
mScheduler->setPreferredRefreshRateForUid(FrameRateOverride{inUid, refreshRate});
mScheduler->onFrameRateOverridesChanged(mAppConnectionHandle, displayId);
- }
return NO_ERROR;
+ }
}
}
return err;