From 7203e1f55a57bf809c3d07a391b82c364fb60b7e Mon Sep 17 00:00:00 2001 From: Stan Iliev Date: Thu, 25 Jul 2019 13:12:02 -0400 Subject: Add GPU draw stats to gfxinfo and GraphicsStatsService Test: ran dumpsys with gfxinfo and graphicsstats Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef --- libs/hwui/ProfileData.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/hwui/ProfileData.h') diff --git a/libs/hwui/ProfileData.h b/libs/hwui/ProfileData.h index 564920b60328..ccbffc6f136e 100644 --- a/libs/hwui/ProfileData.h +++ b/libs/hwui/ProfileData.h @@ -54,8 +54,10 @@ public: void mergeWith(const ProfileData& other); void dump(int fd) const; uint32_t findPercentile(int percentile) const; + uint32_t findGPUPercentile(int percentile) const; void reportFrame(int64_t duration); + void reportGPUFrame(int64_t duration); void reportJank() { mJankFrameCount++; } void reportJankType(JankType type) { mJankTypeCounts[static_cast(type)]++; } @@ -69,15 +71,21 @@ public: uint32_t frameCount; }; void histogramForEach(const std::function& callback) const; + void histogramGPUForEach(const std::function& callback) const; constexpr static int HistogramSize() { return std::tuple_size::value + std::tuple_size::value; } + constexpr static int GPUHistogramSize() { + return std::tuple_size::value; + } + // Visible for testing static uint32_t frameTimeForFrameCountIndex(uint32_t index); static uint32_t frameTimeForSlowFrameCountIndex(uint32_t index); + static uint32_t GPUFrameTimeForFrameCountIndex(uint32_t index); private: // Open our guts up to unit tests @@ -88,6 +96,9 @@ private: std::array mFrameCounts; // Holds a histogram of frame times in 50ms increments from 150ms to 5s std::array mSlowFrameCounts; + // Holds a histogram of GPU draw times in 1ms increments. Frames longer than 25ms are placed in + // last bucket. + std::array mGPUFrameCounts; uint32_t mTotalFrameCount; uint32_t mJankFrameCount; -- cgit v1.2.3-59-g8ed1b