summaryrefslogtreecommitdiff
path: root/libs/hwui/ProfileData.h
diff options
context:
space:
mode:
author Stan Iliev <stani@google.com> 2019-07-25 13:12:02 -0400
committer Stan Iliev <stani@google.com> 2019-08-01 18:53:21 +0000
commit7203e1f55a57bf809c3d07a391b82c364fb60b7e (patch)
tree7471929e5b6ed42cb150bbbb9883e64a5e570007 /libs/hwui/ProfileData.h
parent85a6a5aa3b56749f2f30c442eff8837efb9ebde1 (diff)
Add GPU draw stats to gfxinfo and GraphicsStatsService
Test: ran dumpsys with gfxinfo and graphicsstats Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef
Diffstat (limited to 'libs/hwui/ProfileData.h')
-rw-r--r--libs/hwui/ProfileData.h11
1 files changed, 11 insertions, 0 deletions
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<int>(type)]++; }
@@ -69,15 +71,21 @@ public:
uint32_t frameCount;
};
void histogramForEach(const std::function<void(HistogramEntry)>& callback) const;
+ void histogramGPUForEach(const std::function<void(HistogramEntry)>& callback) const;
constexpr static int HistogramSize() {
return std::tuple_size<decltype(ProfileData::mFrameCounts)>::value +
std::tuple_size<decltype(ProfileData::mSlowFrameCounts)>::value;
}
+ constexpr static int GPUHistogramSize() {
+ return std::tuple_size<decltype(ProfileData::mGPUFrameCounts)>::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<uint32_t, 57> mFrameCounts;
// Holds a histogram of frame times in 50ms increments from 150ms to 5s
std::array<uint16_t, 97> mSlowFrameCounts;
+ // Holds a histogram of GPU draw times in 1ms increments. Frames longer than 25ms are placed in
+ // last bucket.
+ std::array<uint32_t, 26> mGPUFrameCounts;
uint32_t mTotalFrameCount;
uint32_t mJankFrameCount;