blob: 09c32174f75cdf92af83c66fff1dcbc309355bb3 [file] [log] [blame]
Yiwei Zhang0102ad22018-05-02 17:37:17 -07001/*
2 * Copyright 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
Alec Mouri9a29e672020-09-14 12:39:14 -070019#include <cstdint>
Dominik Laskowskif6b4ba62021-11-09 12:46:10 -080020#include <deque>
21#include <mutex>
22#include <optional>
23#include <unordered_map>
24#include <variant>
Peiyong Lin65248e02020-04-18 21:15:07 -070025
Adithya Srinivasanf427f762021-06-15 19:46:26 +000026#include <android/hardware/graphics/composer/2.4/IComposerClient.h>
Alec Mouri7d436ec2021-01-27 20:40:50 -080027#include <gui/JankInfo.h>
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -070028#include <gui/LayerMetadata.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070029#include <timestatsproto/TimeStatsHelper.h>
30#include <timestatsproto/TimeStatsProtoHeader.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070031#include <ui/FenceTime.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070032#include <utils/String16.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070033#include <utils/Vector.h>
34
Dominik Laskowskif6b4ba62021-11-09 12:46:10 -080035#include <scheduler/Fps.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070036
Huihong Luod3d8f8e2022-03-08 14:48:46 -080037using android::gui::GameMode;
38using android::gui::LayerMetadata;
Yiwei Zhang0102ad22018-05-02 17:37:17 -070039using namespace android::surfaceflinger;
40
41namespace android {
Yiwei Zhang0102ad22018-05-02 17:37:17 -070042
43class TimeStats {
Alec Mourifb571ea2019-01-24 18:42:10 -080044public:
Ady Abraham8b9e6122021-01-26 19:11:45 -080045 using SetFrameRateVote = TimeStatsHelper::SetFrameRateVote;
46
Alec Mourifb571ea2019-01-24 18:42:10 -080047 virtual ~TimeStats() = default;
48
Tej Singhe2751772021-04-06 22:05:29 -070049 // Process a pull request from statsd.
Vishnu Nair9cf89262022-02-26 09:17:49 -080050 virtual bool onPullAtom(const int atomId, std::string* pulledData) = 0;
Alec Mouri8e2f31b2020-01-16 22:04:35 +000051
Alec Mourifb571ea2019-01-24 18:42:10 -080052 virtual void parseArgs(bool asProto, const Vector<String16>& args, std::string& result) = 0;
53 virtual bool isEnabled() = 0;
Oliver Nguyenf3b7c9c2019-05-07 13:28:07 -070054 virtual std::string miniDump() = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -080055
56 virtual void incrementTotalFrames() = 0;
57 virtual void incrementMissedFrames() = 0;
Alec Mouri8de697e2020-03-19 10:52:01 -070058 // Increments the number of times the display refresh rate changed.
59 virtual void incrementRefreshRateSwitches() = 0;
Alec Mouri717bcb62020-02-10 17:07:19 -080060 // Records the most up-to-date count of display event connections.
61 // The stored count will be the maximum ever recoded.
62 virtual void recordDisplayEventConnectionCount(int32_t count) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -080063
Alec Mouri9519bf12019-11-15 16:54:44 -080064 // Records the start and end times for a frame.
65 // The start time is the same as the beginning of a SurfaceFlinger
66 // invalidate message.
67 // The end time corresponds to when SurfaceFlinger finishes submitting the
68 // request to HWC to present a frame.
69 virtual void recordFrameDuration(nsecs_t startTime, nsecs_t endTime) = 0;
Alec Mourie4034bb2019-11-19 12:45:54 -080070 // Records the start time and end times for when RenderEngine begins work.
71 // The start time corresponds to the beginning of RenderEngine::drawLayers.
72 // The end time corresponds to when RenderEngine finishes rendering.
73 virtual void recordRenderEngineDuration(nsecs_t startTime, nsecs_t endTime) = 0;
74 // Same as above, but passes in a fence representing the end time.
75 virtual void recordRenderEngineDuration(nsecs_t startTime,
76 const std::shared_ptr<FenceTime>& readyFence) = 0;
Alec Mouri9519bf12019-11-15 16:54:44 -080077
Yiwei Zhang1a88c402019-11-18 10:43:58 -080078 virtual void setPostTime(int32_t layerId, uint64_t frameNumber, const std::string& layerName,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -070079 uid_t uid, nsecs_t postTime, GameMode) = 0;
Yiwei Zhang1a88c402019-11-18 10:43:58 -080080 virtual void setLatchTime(int32_t layerId, uint64_t frameNumber, nsecs_t latchTime) = 0;
Alec Mouri91f6df32020-01-30 08:48:58 -080081 // Reasons why latching a particular buffer may be skipped
82 enum class LatchSkipReason {
83 // If the acquire fence did not fire on some devices we skip latching
84 // the buffer until the fence fires.
85 LateAcquire,
86 };
87 // Increments the counter of skipped latch buffers.
88 virtual void incrementLatchSkipped(int32_t layerId, LatchSkipReason reason) = 0;
89 // Increments the counter of bad desired present times for this layer.
90 // Bad desired present times are "implausible" and cause SurfaceFlinger to
91 // latch a buffer immediately to avoid stalling.
92 virtual void incrementBadDesiredPresent(int32_t layerId) = 0;
Yiwei Zhang1a88c402019-11-18 10:43:58 -080093 virtual void setDesiredTime(int32_t layerId, uint64_t frameNumber, nsecs_t desiredTime) = 0;
94 virtual void setAcquireTime(int32_t layerId, uint64_t frameNumber, nsecs_t acquireTime) = 0;
95 virtual void setAcquireFence(int32_t layerId, uint64_t frameNumber,
Alec Mourifb571ea2019-01-24 18:42:10 -080096 const std::shared_ptr<FenceTime>& acquireFence) = 0;
Alec Mourie4034bb2019-11-19 12:45:54 -080097 // SetPresent{Time, Fence} are not expected to be called in the critical
98 // rendering path, as they flush prior fences if those fences have fired.
Alec Mouri7d436ec2021-01-27 20:40:50 -080099 virtual void setPresentTime(int32_t layerId, uint64_t frameNumber, nsecs_t presentTime,
Ady Abraham8b9e6122021-01-26 19:11:45 -0800100 Fps displayRefreshRate, std::optional<Fps> renderRate,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700101 SetFrameRateVote frameRateVote, GameMode) = 0;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800102 virtual void setPresentFence(int32_t layerId, uint64_t frameNumber,
Alec Mouri7d436ec2021-01-27 20:40:50 -0800103 const std::shared_ptr<FenceTime>& presentFence,
Ady Abraham8b9e6122021-01-26 19:11:45 -0800104 Fps displayRefreshRate, std::optional<Fps> renderRate,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700105 SetFrameRateVote frameRateVote, GameMode) = 0;
Alec Mouri9a29e672020-09-14 12:39:14 -0700106
Alec Mouri7d436ec2021-01-27 20:40:50 -0800107 // Increments janky frames, blamed to the provided {refreshRate, renderRate, uid, layerName}
108 // key, with JankMetadata as supplementary reasons for the jank. Because FrameTimeline is the
109 // infrastructure responsible for computing jank in the system, this is expected to be called
110 // from FrameTimeline, rather than directly from SurfaceFlinger or individual layers. If there
111 // are no jank reasons, then total frames are incremented but jank is not, for accurate
Alec Mouri9a29e672020-09-14 12:39:14 -0700112 // accounting of janky frames.
Alec Mouri363faf02021-01-29 16:34:55 -0800113 // displayDeadlineDelta, displayPresentJitter, and appDeadlineDelta are also provided in order
114 // to provide contextual information about a janky frame. These values may only be uploaded if
115 // there was an associated valid jank reason, and they must be positive. When these frame counts
116 // are incremented, these are also aggregated into a global reporting packet to help with data
117 // validation and assessing of overall device health.
118 struct JankyFramesInfo {
119 Fps refreshRate;
120 std::optional<Fps> renderRate;
121 uid_t uid = 0;
122 std::string layerName;
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700123 GameMode gameMode = GameMode::Unsupported;
Alec Mouri363faf02021-01-29 16:34:55 -0800124 int32_t reasons = 0;
125 nsecs_t displayDeadlineDelta = 0;
126 nsecs_t displayPresentJitter = 0;
127 nsecs_t appDeadlineDelta = 0;
128
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700129 static bool isOptApproxEqual(std::optional<Fps> lhs, std::optional<Fps> rhs) {
130 return (!lhs && !rhs) || (lhs && rhs && isApproxEqual(*lhs, *rhs));
131 }
132
Alec Mouri363faf02021-01-29 16:34:55 -0800133 bool operator==(const JankyFramesInfo& o) const {
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700134 return isApproxEqual(refreshRate, o.refreshRate) &&
135 isOptApproxEqual(renderRate, o.renderRate) && uid == o.uid &&
136 layerName == o.layerName && gameMode == o.gameMode && reasons == o.reasons &&
137 displayDeadlineDelta == o.displayDeadlineDelta &&
Alec Mouri363faf02021-01-29 16:34:55 -0800138 displayPresentJitter == o.displayPresentJitter &&
139 appDeadlineDelta == o.appDeadlineDelta;
140 }
141
142 friend std::ostream& operator<<(std::ostream& os, const JankyFramesInfo& info) {
143 os << "JankyFramesInfo {";
144 os << "\n .refreshRate = " << info.refreshRate;
145 os << "\n .renderRate = "
146 << (info.renderRate ? to_string(*info.renderRate) : "nullopt");
147 os << "\n .uid = " << info.uid;
148 os << "\n .layerName = " << info.layerName;
149 os << "\n .reasons = " << info.reasons;
150 os << "\n .displayDeadlineDelta = " << info.displayDeadlineDelta;
151 os << "\n .displayPresentJitter = " << info.displayPresentJitter;
152 os << "\n .appDeadlineDelta = " << info.appDeadlineDelta;
153 return os << "\n}";
154 }
155 };
156
Vishnu Nair9cf89262022-02-26 09:17:49 -0800157 struct ClientCompositionRecord {
158 // Frame had client composition or mixed composition
159 bool hadClientComposition = false;
160 // Composition changed between hw composition and mixed/client composition
161 bool changed = false;
162 // Frame reused the client composition result from a previous frame
163 bool reused = false;
164 // Composition strategy predicted for frame
165 bool predicted = false;
166 // Composition strategy prediction succeeded
167 bool predictionSucceeded = false;
168
169 // Whether there is data we want to record.
170 bool hasInterestingData() const {
171 return hadClientComposition || changed || reused || predicted;
172 }
173 };
174
Alec Mouri363faf02021-01-29 16:34:55 -0800175 virtual void incrementJankyFrames(const JankyFramesInfo& info) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800176 // Clean up the layer record
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800177 virtual void onDestroy(int32_t layerId) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800178 // If SF skips or rejects a buffer, remove the corresponding TimeRecord.
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800179 virtual void removeTimeRecord(int32_t layerId, uint64_t frameNumber) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800180
Peiyong Lin65248e02020-04-18 21:15:07 -0700181 virtual void setPowerMode(
182 hardware::graphics::composer::V2_4::IComposerClient::PowerMode powerMode) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800183 // Source of truth is RefrehRateStats.
184 virtual void recordRefreshRate(uint32_t fps, nsecs_t duration) = 0;
185 virtual void setPresentFenceGlobal(const std::shared_ptr<FenceTime>& presentFence) = 0;
Vishnu Nair9cf89262022-02-26 09:17:49 -0800186 virtual void pushCompositionStrategyState(const ClientCompositionRecord&) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800187};
188
189namespace impl {
190
191class TimeStats : public android::TimeStats {
Peiyong Lin65248e02020-04-18 21:15:07 -0700192 using PowerMode = android::hardware::graphics::composer::V2_4::IComposerClient::PowerMode;
193
Yiwei Zhangcf50ab92018-06-14 10:50:12 -0700194 struct FrameTime {
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700195 uint64_t frameNumber = 0;
196 nsecs_t postTime = 0;
197 nsecs_t latchTime = 0;
198 nsecs_t acquireTime = 0;
199 nsecs_t desiredTime = 0;
200 nsecs_t presentTime = 0;
Yiwei Zhangcf50ab92018-06-14 10:50:12 -0700201 };
202
203 struct TimeRecord {
204 bool ready = false;
205 FrameTime frameTime;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700206 std::shared_ptr<FenceTime> acquireFence;
207 std::shared_ptr<FenceTime> presentFence;
208 };
209
210 struct LayerRecord {
Alec Mouri9a29e672020-09-14 12:39:14 -0700211 uid_t uid;
Yiwei Zhang9689e2f2018-05-11 12:33:23 -0700212 std::string layerName;
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700213 GameMode gameMode = GameMode::Unsupported;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700214 // This is the index in timeRecords, at which the timestamps for that
215 // specific frame are still not fully received. This is not waiting for
216 // fences to signal, but rather waiting to receive those fences/timestamps.
217 int32_t waitData = -1;
Yiwei Zhangeaeea062018-06-28 14:46:51 -0700218 uint32_t droppedFrames = 0;
Alec Mouri91f6df32020-01-30 08:48:58 -0800219 uint32_t lateAcquireFrames = 0;
220 uint32_t badDesiredPresentFrames = 0;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700221 TimeRecord prevTimeRecord;
Alberto Gonzalez9fe14512022-09-29 21:27:34 +0000222 std::optional<int32_t> prevPresentToPresentMs;
Yiwei Zhangc5f2c452018-05-08 16:31:56 -0700223 std::deque<TimeRecord> timeRecords;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700224 };
225
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700226 struct PowerTime {
Peiyong Lin65248e02020-04-18 21:15:07 -0700227 PowerMode powerMode = PowerMode::OFF;
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700228 nsecs_t prevTime = 0;
229 };
230
Alec Mourie4034bb2019-11-19 12:45:54 -0800231 struct RenderEngineDuration {
232 nsecs_t startTime;
233 std::variant<nsecs_t, std::shared_ptr<FenceTime>> endTime;
234 };
235
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700236 struct GlobalRecord {
237 nsecs_t prevPresentTime = 0;
238 std::deque<std::shared_ptr<FenceTime>> presentFences;
Alec Mourie4034bb2019-11-19 12:45:54 -0800239 std::deque<RenderEngineDuration> renderEngineDurations;
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700240 };
241
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700242public:
Alec Mourib3885ad2019-09-06 17:08:55 -0700243 TimeStats();
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000244 // For testing only for injecting custom dependencies.
Tej Singhe2751772021-04-06 22:05:29 -0700245 TimeStats(std::optional<size_t> maxPulledLayers,
Alec Mouri37384342020-01-02 17:23:37 -0800246 std::optional<size_t> maxPulledHistogramBuckets);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000247
Tej Singhe2751772021-04-06 22:05:29 -0700248 bool onPullAtom(const int atomId, std::string* pulledData) override;
Alec Mourifb571ea2019-01-24 18:42:10 -0800249 void parseArgs(bool asProto, const Vector<String16>& args, std::string& result) override;
250 bool isEnabled() override;
Yiwei Zhang7eb58b72019-04-22 19:00:02 -0700251 std::string miniDump() override;
Yiwei Zhang7e666a52018-11-15 13:33:42 -0800252
Alec Mourifb571ea2019-01-24 18:42:10 -0800253 void incrementTotalFrames() override;
254 void incrementMissedFrames() override;
Alec Mouri8de697e2020-03-19 10:52:01 -0700255 void incrementRefreshRateSwitches() override;
Alec Mouri717bcb62020-02-10 17:07:19 -0800256 void recordDisplayEventConnectionCount(int32_t count) override;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700257
Alec Mouri9519bf12019-11-15 16:54:44 -0800258 void recordFrameDuration(nsecs_t startTime, nsecs_t endTime) override;
Alec Mourie4034bb2019-11-19 12:45:54 -0800259 void recordRenderEngineDuration(nsecs_t startTime, nsecs_t endTime) override;
260 void recordRenderEngineDuration(nsecs_t startTime,
261 const std::shared_ptr<FenceTime>& readyFence) override;
Alec Mouri9519bf12019-11-15 16:54:44 -0800262
Alec Mouri9a29e672020-09-14 12:39:14 -0700263 void setPostTime(int32_t layerId, uint64_t frameNumber, const std::string& layerName, uid_t uid,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700264 nsecs_t postTime, GameMode) override;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800265 void setLatchTime(int32_t layerId, uint64_t frameNumber, nsecs_t latchTime) override;
Alec Mouri91f6df32020-01-30 08:48:58 -0800266 void incrementLatchSkipped(int32_t layerId, LatchSkipReason reason) override;
267 void incrementBadDesiredPresent(int32_t layerId) override;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800268 void setDesiredTime(int32_t layerId, uint64_t frameNumber, nsecs_t desiredTime) override;
269 void setAcquireTime(int32_t layerId, uint64_t frameNumber, nsecs_t acquireTime) override;
270 void setAcquireFence(int32_t layerId, uint64_t frameNumber,
Alec Mourifb571ea2019-01-24 18:42:10 -0800271 const std::shared_ptr<FenceTime>& acquireFence) override;
Alec Mouri7d436ec2021-01-27 20:40:50 -0800272 void setPresentTime(int32_t layerId, uint64_t frameNumber, nsecs_t presentTime,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700273 Fps displayRefreshRate, std::optional<Fps> renderRate, SetFrameRateVote,
274 GameMode) override;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800275 void setPresentFence(int32_t layerId, uint64_t frameNumber,
Alec Mouri7d436ec2021-01-27 20:40:50 -0800276 const std::shared_ptr<FenceTime>& presentFence, Fps displayRefreshRate,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700277 std::optional<Fps> renderRate, SetFrameRateVote, GameMode) override;
Alec Mouri363faf02021-01-29 16:34:55 -0800278
279 void incrementJankyFrames(const JankyFramesInfo& info) override;
Yiwei Zhangaf8ee942018-11-22 00:15:23 -0800280 // Clean up the layer record
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800281 void onDestroy(int32_t layerId) override;
Yiwei Zhangeaeea062018-06-28 14:46:51 -0700282 // If SF skips or rejects a buffer, remove the corresponding TimeRecord.
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800283 void removeTimeRecord(int32_t layerId, uint64_t frameNumber) override;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700284
Peiyong Lin65248e02020-04-18 21:15:07 -0700285 void setPowerMode(
286 hardware::graphics::composer::V2_4::IComposerClient::PowerMode powerMode) override;
Alec Mourifb571ea2019-01-24 18:42:10 -0800287 // Source of truth is RefrehRateStats.
288 void recordRefreshRate(uint32_t fps, nsecs_t duration) override;
289 void setPresentFenceGlobal(const std::shared_ptr<FenceTime>& presentFence) override;
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700290
Vishnu Nair9cf89262022-02-26 09:17:49 -0800291 void pushCompositionStrategyState(const ClientCompositionRecord&) override;
292
Yiwei Zhangaf8ee942018-11-22 00:15:23 -0800293 static const size_t MAX_NUM_TIME_RECORDS = 64;
294
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700295private:
Tej Singhe2751772021-04-06 22:05:29 -0700296 bool populateGlobalAtom(std::string* pulledData);
297 bool populateLayerAtom(std::string* pulledData);
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800298 bool recordReadyLocked(int32_t layerId, TimeRecord* timeRecord);
Alec Mouri7d436ec2021-01-27 20:40:50 -0800299 void flushAvailableRecordsToStatsLocked(int32_t layerId, Fps displayRefreshRate,
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700300 std::optional<Fps> renderRate, SetFrameRateVote,
301 GameMode);
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700302 void flushPowerTimeLocked();
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700303 void flushAvailableGlobalRecordsToStatsLocked();
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700304 bool canAddNewAggregatedStats(uid_t uid, const std::string& layerName, GameMode);
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700305
306 void enable();
307 void disable();
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000308 void clearAll();
309 void clearGlobalLocked();
310 void clearLayersLocked();
Yiwei Zhang5434a782018-12-05 18:06:32 -0800311 void dump(bool asProto, std::optional<uint32_t> maxLayers, std::string& result);
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700312
313 std::atomic<bool> mEnabled = false;
314 std::mutex mMutex;
Yiwei Zhangdc224042018-10-18 15:34:00 -0700315 TimeStatsHelper::TimeStatsGlobal mTimeStats;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800316 // Hashmap for LayerRecord with layerId as the hash key
Yiwei Zhang9689e2f2018-05-11 12:33:23 -0700317 std::unordered_map<int32_t, LayerRecord> mTimeStatsTracker;
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700318 PowerTime mPowerTime;
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700319 GlobalRecord mGlobalRecord;
Yiwei Zhang7eb58b72019-04-22 19:00:02 -0700320
321 static const size_t MAX_NUM_LAYER_RECORDS = 200;
Alec Mouri7d436ec2021-01-27 20:40:50 -0800322
323 static const size_t REFRESH_RATE_BUCKET_WIDTH = 30;
324 static const size_t RENDER_RATE_BUCKET_WIDTH = REFRESH_RATE_BUCKET_WIDTH;
Yiwei Zhange926ab52019-08-14 15:16:00 -0700325 static const size_t MAX_NUM_LAYER_STATS = 200;
Alec Mouri52bf7802021-01-20 08:20:50 -0800326 static const size_t MAX_NUM_PULLED_LAYERS = MAX_NUM_LAYER_STATS;
Alec Mouri52bf7802021-01-20 08:20:50 -0800327 size_t mMaxPulledLayers = MAX_NUM_PULLED_LAYERS;
Alec Mouri37384342020-01-02 17:23:37 -0800328 size_t mMaxPulledHistogramBuckets = 6;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700329};
330
Alec Mourifb571ea2019-01-24 18:42:10 -0800331} // namespace impl
332
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700333} // namespace android