surfaceflinger: Frame missed count added to dumpsys SF
Bug: 80090729
Test: adb shell dumpsys SurfaceFlinger
Change-Id: I36a38a54c600abefd279a9d2698a96d9df80ca68
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 54de3e5..fb9d6d8 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1466,6 +1466,7 @@
mPreviousPresentFence != Fence::NO_FENCE &&
(mPreviousPresentFence->getSignalTime() ==
Fence::SIGNAL_TIME_PENDING);
+ mFrameMissedCount += frameMissed;
ATRACE_INT("FrameMissed", static_cast<int>(frameMissed));
if (frameMissed) {
mTimeStats.incrementMissedFrames();
@@ -4340,6 +4341,8 @@
dumpStaticScreenStats(result);
result.append("\n");
+ result.appendFormat("Missed frame count: %u\n\n", mFrameMissedCount.load());
+
dumpBufferingStats(result);
/*
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 4bb86c5..962c1dc 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -840,6 +840,7 @@
LayerStats mLayerStats;
TimeStats& mTimeStats = TimeStats::getInstance();
bool mUseHwcVirtualDisplays = false;
+ std::atomic<uint32_t> mFrameMissedCount{0};
// Restrict layers to use two buffers in their bufferqueues.
bool mLayerTripleBufferingDisabled = false;