SF Timestats: add new metrics
Add the new metrics below:
1) dropped buffers per layer
2) post to acquire histogram
Stop tracking the start and end time for each layer since that doesn't
give any meaningful information. The total/dropped frame per layer is
good enough for now.
Test: dumpsys SurfaceFlinger --timestats <see go/sf-timestats for args>
Bug: b/110954467
Change-Id: I1c8a3a6cc76b7ec4a2e9ab86d9237af95fe9d1e1
diff --git a/services/surfaceflinger/TimeStats/TimeStats.h b/services/surfaceflinger/TimeStats/TimeStats.h
index 0b1f82e..5ab3934 100644
--- a/services/surfaceflinger/TimeStats/TimeStats.h
+++ b/services/surfaceflinger/TimeStats/TimeStats.h
@@ -61,6 +61,7 @@
// specific frame are still not fully received. This is not waiting for
// fences to signal, but rather waiting to receive those fences/timestamps.
int32_t waitData = -1;
+ uint32_t droppedFrames = 0;
TimeRecord prevTimeRecord;
std::deque<TimeRecord> timeRecords;
};
@@ -81,8 +82,11 @@
void setPresentTime(const std::string& layerName, uint64_t frameNumber, nsecs_t presentTime);
void setPresentFence(const std::string& layerName, uint64_t frameNumber,
const std::shared_ptr<FenceTime>& presentFence);
+ // On producer disconnect with BufferQueue.
void onDisconnect(const std::string& layerName);
+ // When SF is cleaning up the queue, clear the LayerRecord as well.
void clearLayerRecord(const std::string& layerName);
+ // If SF skips or rejects a buffer, remove the corresponding TimeRecord.
void removeTimeRecord(const std::string& layerName, uint64_t frameNumber);
private: