summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-03-24 15:57:01 -0700
committerJohn Reck <jreck@google.com>2016-03-24 17:22:45 -0700
commit5ed587f25b367cfd1f68279d6cd96ee403bd6f34 (patch)
treea3c8fdf6db6814d577fc0abed8b6c7074e4d6d28 /libs/hwui/JankTracker.h
parentdf1e2b1457690ccbd1302078cedafbfbb8918265 (diff)
Track slowest frames
Fixes: 27795291 Track the 10 slowest frames over the last 24 hours to try and give approximate insight into total system health. Change-Id: I8aa646cef0bea185d46b3c78478266bc01d17fd7
Diffstat (limited to 'libs/hwui/JankTracker.h')
-rw-r--r--libs/hwui/JankTracker.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h
index 3887e5e65d60..1a4a4897f496 100644
--- a/libs/hwui/JankTracker.h
+++ b/libs/hwui/JankTracker.h
@@ -39,6 +39,11 @@ enum JankType {
NUM_BUCKETS,
};
+struct SlowFrame {
+ uint16_t whenHours; // When this occurred in CLOCK_MONOTONIC in hours
+ uint16_t frametimeMs; // How long the frame took in ms
+};
+
// Try to keep as small as possible, should match ASHMEM_SIZE in
// GraphicsStatsService.java
struct ProfileData {
@@ -49,6 +54,8 @@ struct ProfileData {
uint32_t totalFrameCount;
uint32_t jankFrameCount;
nsecs_t statStartTime;
+
+ std::array<SlowFrame, 10> slowestFrames;
};
// TODO: Replace DrawProfiler with this
@@ -71,6 +78,7 @@ public:
private:
void freeData();
void setFrameInterval(nsecs_t frameIntervalNanos);
+ void updateSlowest(const FrameInfo& frame);
static uint32_t findPercentile(const ProfileData* data, int p);
static void dumpData(const ProfileData* data, int fd);