blob: 4fa0a027707108ba0699ea7b25616ae26c6dea2a [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
Peiyong Lin65248e02020-04-18 21:15:07 -070019// TODO(b/129481165): remove the #pragma below and fix conversion issues
Alec Mouri9a29e672020-09-14 12:39:14 -070020#include <cstdint>
Peiyong Lin65248e02020-04-18 21:15:07 -070021#pragma clang diagnostic push
22#pragma clang diagnostic ignored "-Wconversion"
23
24#include <android/hardware/graphics/composer/2.4/IComposerClient.h>
25
26// TODO(b/129481165): remove the #pragma below and fix conversion issues
27#pragma clang diagnostic pop // ignored "-Wconversion"
28
Alec Mouri8e2f31b2020-01-16 22:04:35 +000029#include <stats_event.h>
30#include <stats_pull_atom_callback.h>
31#include <statslog.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070032#include <timestatsproto/TimeStatsHelper.h>
33#include <timestatsproto/TimeStatsProtoHeader.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070034#include <ui/FenceTime.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070035#include <utils/String16.h>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070036#include <utils/Vector.h>
37
Yiwei Zhangc5f2c452018-05-08 16:31:56 -070038#include <deque>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070039#include <mutex>
Yiwei Zhang8a4015c2018-05-08 16:03:47 -070040#include <optional>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070041#include <unordered_map>
Alec Mourie4034bb2019-11-19 12:45:54 -080042#include <variant>
Yiwei Zhang0102ad22018-05-02 17:37:17 -070043
44using namespace android::surfaceflinger;
45
46namespace android {
Yiwei Zhang0102ad22018-05-02 17:37:17 -070047
48class TimeStats {
Alec Mourifb571ea2019-01-24 18:42:10 -080049public:
50 virtual ~TimeStats() = default;
51
Alec Mouri8e2f31b2020-01-16 22:04:35 +000052 // Called once boot has been finished to perform additional capabilities,
53 // e.g. registration to statsd.
54 virtual void onBootFinished() = 0;
55
Alec Mourifb571ea2019-01-24 18:42:10 -080056 virtual void parseArgs(bool asProto, const Vector<String16>& args, std::string& result) = 0;
57 virtual bool isEnabled() = 0;
Oliver Nguyenf3b7c9c2019-05-07 13:28:07 -070058 virtual std::string miniDump() = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -080059
60 virtual void incrementTotalFrames() = 0;
61 virtual void incrementMissedFrames() = 0;
62 virtual void incrementClientCompositionFrames() = 0;
Vishnu Nair9b079a22020-01-21 14:36:08 -080063 virtual void incrementClientCompositionReusedFrames() = 0;
Alec Mouri8de697e2020-03-19 10:52:01 -070064 // Increments the number of times the display refresh rate changed.
65 virtual void incrementRefreshRateSwitches() = 0;
Alec Mouri8f7a0102020-04-15 12:11:10 -070066 // Increments the number of changes in composition strategy
67 // The intention is to reflect the number of changes between hwc and gpu
68 // composition, where "gpu composition" may also include mixed composition.
69 virtual void incrementCompositionStrategyChanges() = 0;
Alec Mouri717bcb62020-02-10 17:07:19 -080070 // Records the most up-to-date count of display event connections.
71 // The stored count will be the maximum ever recoded.
72 virtual void recordDisplayEventConnectionCount(int32_t count) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -080073
Alec Mouri9519bf12019-11-15 16:54:44 -080074 // Records the start and end times for a frame.
75 // The start time is the same as the beginning of a SurfaceFlinger
76 // invalidate message.
77 // The end time corresponds to when SurfaceFlinger finishes submitting the
78 // request to HWC to present a frame.
79 virtual void recordFrameDuration(nsecs_t startTime, nsecs_t endTime) = 0;
Alec Mourie4034bb2019-11-19 12:45:54 -080080 // Records the start time and end times for when RenderEngine begins work.
81 // The start time corresponds to the beginning of RenderEngine::drawLayers.
82 // The end time corresponds to when RenderEngine finishes rendering.
83 virtual void recordRenderEngineDuration(nsecs_t startTime, nsecs_t endTime) = 0;
84 // Same as above, but passes in a fence representing the end time.
85 virtual void recordRenderEngineDuration(nsecs_t startTime,
86 const std::shared_ptr<FenceTime>& readyFence) = 0;
Alec Mouri9519bf12019-11-15 16:54:44 -080087
Yiwei Zhang1a88c402019-11-18 10:43:58 -080088 virtual void setPostTime(int32_t layerId, uint64_t frameNumber, const std::string& layerName,
Alec Mouri9a29e672020-09-14 12:39:14 -070089 uid_t uid, nsecs_t postTime) = 0;
Yiwei Zhang1a88c402019-11-18 10:43:58 -080090 virtual void setLatchTime(int32_t layerId, uint64_t frameNumber, nsecs_t latchTime) = 0;
Alec Mouri91f6df32020-01-30 08:48:58 -080091 // Reasons why latching a particular buffer may be skipped
92 enum class LatchSkipReason {
93 // If the acquire fence did not fire on some devices we skip latching
94 // the buffer until the fence fires.
95 LateAcquire,
96 };
97 // Increments the counter of skipped latch buffers.
98 virtual void incrementLatchSkipped(int32_t layerId, LatchSkipReason reason) = 0;
99 // Increments the counter of bad desired present times for this layer.
100 // Bad desired present times are "implausible" and cause SurfaceFlinger to
101 // latch a buffer immediately to avoid stalling.
102 virtual void incrementBadDesiredPresent(int32_t layerId) = 0;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800103 virtual void setDesiredTime(int32_t layerId, uint64_t frameNumber, nsecs_t desiredTime) = 0;
104 virtual void setAcquireTime(int32_t layerId, uint64_t frameNumber, nsecs_t acquireTime) = 0;
105 virtual void setAcquireFence(int32_t layerId, uint64_t frameNumber,
Alec Mourifb571ea2019-01-24 18:42:10 -0800106 const std::shared_ptr<FenceTime>& acquireFence) = 0;
Alec Mourie4034bb2019-11-19 12:45:54 -0800107 // SetPresent{Time, Fence} are not expected to be called in the critical
108 // rendering path, as they flush prior fences if those fences have fired.
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800109 virtual void setPresentTime(int32_t layerId, uint64_t frameNumber, nsecs_t presentTime) = 0;
110 virtual void setPresentFence(int32_t layerId, uint64_t frameNumber,
Alec Mourifb571ea2019-01-24 18:42:10 -0800111 const std::shared_ptr<FenceTime>& presentFence) = 0;
Alec Mouri9a29e672020-09-14 12:39:14 -0700112
113 // Subset of jank metadata tracked by FrameTimeline for the purpose of funneling to telemetry.
114 enum JankType {
115 // No Jank
116 None = 0x0,
117 // Jank not related to SurfaceFlinger or the App
118 Display = 0x1,
119 // SF took too long on the CPU
120 SurfaceFlingerDeadlineMissed = 0x2,
121 // SF took too long on the GPU
122 SurfaceFlingerGpuDeadlineMissed = 0x4,
123 // Either App or GPU took too long on the frame
124 AppDeadlineMissed = 0x8,
125 // Predictions live for 120ms, if prediction is expired for a frame, there is definitely a
126 // jank
127 // associated with the App if this is for a SurfaceFrame, and SF for a DisplayFrame.
128 PredictionExpired = 0x10,
129 // Latching a buffer early might cause an early present of the frame
130 SurfaceFlingerEarlyLatch = 0x20,
131 };
132
133 // Increments janky frames, tracked globally. Because FrameTimeline is the infrastructure
134 // responsible for computing jank in the system, this is expected to be called from
135 // FrameTimeline, rather than directly from SurfaceFlinger or individual layers. If there are no
136 // jank reasons, then total frames are incremented but jank is not, for accurate accounting of
137 // janky frames.
138 virtual void incrementJankyFrames(int32_t reasons) = 0;
139 // Increments janky frames, blamed to the provided {uid, layerName} key, with JankMetadata as
140 // supplementary reasons for the jank. Because FrameTimeline is the infrastructure responsible
141 // for computing jank in the system, this is expected to be called from FrameTimeline, rather
142 // than directly from SurfaceFlinger or individual layers.
143 // If there are no jank reasons, then total frames are incremented but jank is not, for accurate
144 // accounting of janky frames.
145 virtual void incrementJankyFrames(uid_t uid, const std::string& layerName, int32_t reasons) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800146 // Clean up the layer record
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800147 virtual void onDestroy(int32_t layerId) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800148 // If SF skips or rejects a buffer, remove the corresponding TimeRecord.
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800149 virtual void removeTimeRecord(int32_t layerId, uint64_t frameNumber) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800150
Peiyong Lin65248e02020-04-18 21:15:07 -0700151 virtual void setPowerMode(
152 hardware::graphics::composer::V2_4::IComposerClient::PowerMode powerMode) = 0;
Alec Mourifb571ea2019-01-24 18:42:10 -0800153 // Source of truth is RefrehRateStats.
154 virtual void recordRefreshRate(uint32_t fps, nsecs_t duration) = 0;
155 virtual void setPresentFenceGlobal(const std::shared_ptr<FenceTime>& presentFence) = 0;
156};
157
158namespace impl {
159
160class TimeStats : public android::TimeStats {
Peiyong Lin65248e02020-04-18 21:15:07 -0700161 using PowerMode = android::hardware::graphics::composer::V2_4::IComposerClient::PowerMode;
162
Yiwei Zhangcf50ab92018-06-14 10:50:12 -0700163 struct FrameTime {
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700164 uint64_t frameNumber = 0;
165 nsecs_t postTime = 0;
166 nsecs_t latchTime = 0;
167 nsecs_t acquireTime = 0;
168 nsecs_t desiredTime = 0;
169 nsecs_t presentTime = 0;
Yiwei Zhangcf50ab92018-06-14 10:50:12 -0700170 };
171
172 struct TimeRecord {
173 bool ready = false;
174 FrameTime frameTime;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700175 std::shared_ptr<FenceTime> acquireFence;
176 std::shared_ptr<FenceTime> presentFence;
177 };
178
179 struct LayerRecord {
Alec Mouri9a29e672020-09-14 12:39:14 -0700180 uid_t uid;
Yiwei Zhang9689e2f2018-05-11 12:33:23 -0700181 std::string layerName;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700182 // This is the index in timeRecords, at which the timestamps for that
183 // specific frame are still not fully received. This is not waiting for
184 // fences to signal, but rather waiting to receive those fences/timestamps.
185 int32_t waitData = -1;
Yiwei Zhangeaeea062018-06-28 14:46:51 -0700186 uint32_t droppedFrames = 0;
Alec Mouri91f6df32020-01-30 08:48:58 -0800187 uint32_t lateAcquireFrames = 0;
188 uint32_t badDesiredPresentFrames = 0;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700189 TimeRecord prevTimeRecord;
Yiwei Zhangc5f2c452018-05-08 16:31:56 -0700190 std::deque<TimeRecord> timeRecords;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700191 };
192
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700193 struct PowerTime {
Peiyong Lin65248e02020-04-18 21:15:07 -0700194 PowerMode powerMode = PowerMode::OFF;
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700195 nsecs_t prevTime = 0;
196 };
197
Alec Mourie4034bb2019-11-19 12:45:54 -0800198 struct RenderEngineDuration {
199 nsecs_t startTime;
200 std::variant<nsecs_t, std::shared_ptr<FenceTime>> endTime;
201 };
202
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700203 struct GlobalRecord {
204 nsecs_t prevPresentTime = 0;
205 std::deque<std::shared_ptr<FenceTime>> presentFences;
Alec Mourie4034bb2019-11-19 12:45:54 -0800206 std::deque<RenderEngineDuration> renderEngineDurations;
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700207 };
208
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700209public:
Alec Mourib3885ad2019-09-06 17:08:55 -0700210 TimeStats();
Yiwei Zhang7e666a52018-11-15 13:33:42 -0800211
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000212 // Delegate to the statsd service and associated APIs.
213 // Production code may use this class directly, whereas unit test may define
214 // a subclass for ease of testing.
215 class StatsEventDelegate {
216 public:
217 virtual ~StatsEventDelegate() = default;
Tej Singh2a457b62020-01-31 16:16:10 -0800218 virtual AStatsEvent* addStatsEventToPullData(AStatsEventList* data) {
219 return AStatsEventList_addStatsEvent(data);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000220 }
Tej Singh38a4b212020-03-13 19:04:51 -0700221 virtual void setStatsPullAtomCallback(int32_t atom_tag,
222 AStatsManager_PullAtomMetadata* metadata,
223 AStatsManager_PullAtomCallback callback,
224 void* cookie) {
225 return AStatsManager_setPullAtomCallback(atom_tag, metadata, callback, cookie);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000226 }
227
Tej Singh38a4b212020-03-13 19:04:51 -0700228 virtual void clearStatsPullAtomCallback(int32_t atom_tag) {
229 return AStatsManager_clearPullAtomCallback(atom_tag);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000230 }
231
Tej Singh2a457b62020-01-31 16:16:10 -0800232 virtual void statsEventSetAtomId(AStatsEvent* event, uint32_t atom_id) {
233 return AStatsEvent_setAtomId(event, atom_id);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000234 }
235
Alec Mouri717bcb62020-02-10 17:07:19 -0800236 virtual void statsEventWriteInt32(AStatsEvent* event, int32_t field) {
237 return AStatsEvent_writeInt32(event, field);
238 }
239
Tej Singh2a457b62020-01-31 16:16:10 -0800240 virtual void statsEventWriteInt64(AStatsEvent* event, int64_t field) {
241 return AStatsEvent_writeInt64(event, field);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000242 }
243
Tej Singh2a457b62020-01-31 16:16:10 -0800244 virtual void statsEventWriteString8(AStatsEvent* event, const char* field) {
245 return AStatsEvent_writeString(event, field);
Alec Mouri37384342020-01-02 17:23:37 -0800246 }
247
Tej Singh2a457b62020-01-31 16:16:10 -0800248 virtual void statsEventWriteByteArray(AStatsEvent* event, const uint8_t* buf,
Alec Mouri37384342020-01-02 17:23:37 -0800249 size_t numBytes) {
Tej Singh2a457b62020-01-31 16:16:10 -0800250 return AStatsEvent_writeByteArray(event, buf, numBytes);
Alec Mouri37384342020-01-02 17:23:37 -0800251 }
252
Tej Singh2a457b62020-01-31 16:16:10 -0800253 virtual void statsEventBuild(AStatsEvent* event) { return AStatsEvent_build(event); }
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000254 };
255 // For testing only for injecting custom dependencies.
Alec Mouri37384342020-01-02 17:23:37 -0800256 TimeStats(std::unique_ptr<StatsEventDelegate> statsDelegate,
257 std::optional<size_t> maxPulledLayers,
258 std::optional<size_t> maxPulledHistogramBuckets);
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000259
Alec Mouri3ecd5cd2020-01-29 12:53:07 -0800260 ~TimeStats() override;
261
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000262 void onBootFinished() override;
Alec Mourifb571ea2019-01-24 18:42:10 -0800263 void parseArgs(bool asProto, const Vector<String16>& args, std::string& result) override;
264 bool isEnabled() override;
Yiwei Zhang7eb58b72019-04-22 19:00:02 -0700265 std::string miniDump() override;
Yiwei Zhang7e666a52018-11-15 13:33:42 -0800266
Alec Mourifb571ea2019-01-24 18:42:10 -0800267 void incrementTotalFrames() override;
268 void incrementMissedFrames() override;
269 void incrementClientCompositionFrames() override;
Vishnu Nair9b079a22020-01-21 14:36:08 -0800270 void incrementClientCompositionReusedFrames() override;
Alec Mouri8de697e2020-03-19 10:52:01 -0700271 void incrementRefreshRateSwitches() override;
Alec Mouri8f7a0102020-04-15 12:11:10 -0700272 void incrementCompositionStrategyChanges() override;
Alec Mouri717bcb62020-02-10 17:07:19 -0800273 void recordDisplayEventConnectionCount(int32_t count) override;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700274
Alec Mouri9519bf12019-11-15 16:54:44 -0800275 void recordFrameDuration(nsecs_t startTime, nsecs_t endTime) override;
Alec Mourie4034bb2019-11-19 12:45:54 -0800276 void recordRenderEngineDuration(nsecs_t startTime, nsecs_t endTime) override;
277 void recordRenderEngineDuration(nsecs_t startTime,
278 const std::shared_ptr<FenceTime>& readyFence) override;
Alec Mouri9519bf12019-11-15 16:54:44 -0800279
Alec Mouri9a29e672020-09-14 12:39:14 -0700280 void setPostTime(int32_t layerId, uint64_t frameNumber, const std::string& layerName, uid_t uid,
Alec Mourifb571ea2019-01-24 18:42:10 -0800281 nsecs_t postTime) override;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800282 void setLatchTime(int32_t layerId, uint64_t frameNumber, nsecs_t latchTime) override;
Alec Mouri91f6df32020-01-30 08:48:58 -0800283 void incrementLatchSkipped(int32_t layerId, LatchSkipReason reason) override;
284 void incrementBadDesiredPresent(int32_t layerId) override;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800285 void setDesiredTime(int32_t layerId, uint64_t frameNumber, nsecs_t desiredTime) override;
286 void setAcquireTime(int32_t layerId, uint64_t frameNumber, nsecs_t acquireTime) override;
287 void setAcquireFence(int32_t layerId, uint64_t frameNumber,
Alec Mourifb571ea2019-01-24 18:42:10 -0800288 const std::shared_ptr<FenceTime>& acquireFence) override;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800289 void setPresentTime(int32_t layerId, uint64_t frameNumber, nsecs_t presentTime) override;
290 void setPresentFence(int32_t layerId, uint64_t frameNumber,
Alec Mourifb571ea2019-01-24 18:42:10 -0800291 const std::shared_ptr<FenceTime>& presentFence) override;
Alec Mouri9a29e672020-09-14 12:39:14 -0700292 void incrementJankyFrames(int32_t reasons) override;
293 void incrementJankyFrames(uid_t uid, const std::string& layerName, int32_t reasons) override;
Yiwei Zhangaf8ee942018-11-22 00:15:23 -0800294 // Clean up the layer record
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800295 void onDestroy(int32_t layerId) override;
Yiwei Zhangeaeea062018-06-28 14:46:51 -0700296 // If SF skips or rejects a buffer, remove the corresponding TimeRecord.
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800297 void removeTimeRecord(int32_t layerId, uint64_t frameNumber) override;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700298
Peiyong Lin65248e02020-04-18 21:15:07 -0700299 void setPowerMode(
300 hardware::graphics::composer::V2_4::IComposerClient::PowerMode powerMode) override;
Alec Mourifb571ea2019-01-24 18:42:10 -0800301 // Source of truth is RefrehRateStats.
302 void recordRefreshRate(uint32_t fps, nsecs_t duration) override;
303 void setPresentFenceGlobal(const std::shared_ptr<FenceTime>& presentFence) override;
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700304
Yiwei Zhangaf8ee942018-11-22 00:15:23 -0800305 static const size_t MAX_NUM_TIME_RECORDS = 64;
306
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700307private:
Tej Singh2a457b62020-01-31 16:16:10 -0800308 static AStatsManager_PullAtomCallbackReturn pullAtomCallback(int32_t atom_tag,
309 AStatsEventList* data,
310 void* cookie);
311 AStatsManager_PullAtomCallbackReturn populateGlobalAtom(AStatsEventList* data);
312 AStatsManager_PullAtomCallbackReturn populateLayerAtom(AStatsEventList* data);
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800313 bool recordReadyLocked(int32_t layerId, TimeRecord* timeRecord);
314 void flushAvailableRecordsToStatsLocked(int32_t layerId);
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700315 void flushPowerTimeLocked();
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700316 void flushAvailableGlobalRecordsToStatsLocked();
Alec Mouri9a29e672020-09-14 12:39:14 -0700317 bool canAddNewAggregatedStats(uid_t uid, const std::string& layerName);
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700318
319 void enable();
320 void disable();
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000321 void clearAll();
322 void clearGlobalLocked();
323 void clearLayersLocked();
Yiwei Zhang5434a782018-12-05 18:06:32 -0800324 void dump(bool asProto, std::optional<uint32_t> maxLayers, std::string& result);
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700325
326 std::atomic<bool> mEnabled = false;
327 std::mutex mMutex;
Yiwei Zhangdc224042018-10-18 15:34:00 -0700328 TimeStatsHelper::TimeStatsGlobal mTimeStats;
Yiwei Zhang1a88c402019-11-18 10:43:58 -0800329 // Hashmap for LayerRecord with layerId as the hash key
Yiwei Zhang9689e2f2018-05-11 12:33:23 -0700330 std::unordered_map<int32_t, LayerRecord> mTimeStatsTracker;
Yiwei Zhang3a226d22018-10-16 09:23:03 -0700331 PowerTime mPowerTime;
Yiwei Zhangce6ebc02018-10-20 12:42:38 -0700332 GlobalRecord mGlobalRecord;
Yiwei Zhang7eb58b72019-04-22 19:00:02 -0700333
334 static const size_t MAX_NUM_LAYER_RECORDS = 200;
Yiwei Zhange926ab52019-08-14 15:16:00 -0700335 static const size_t MAX_NUM_LAYER_STATS = 200;
Alec Mouri8e2f31b2020-01-16 22:04:35 +0000336 std::unique_ptr<StatsEventDelegate> mStatsDelegate = std::make_unique<StatsEventDelegate>();
Alec Mouri37384342020-01-02 17:23:37 -0800337 size_t mMaxPulledLayers = 8;
338 size_t mMaxPulledHistogramBuckets = 6;
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700339};
340
Alec Mourifb571ea2019-01-24 18:42:10 -0800341} // namespace impl
342
Yiwei Zhang0102ad22018-05-02 17:37:17 -0700343} // namespace android