From f97824d368cda4037a7878a6c00821e85ab3fa5b Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 1 Dec 2015 15:51:05 -0800 Subject: [PATCH] Add a counter to trace VSync events from the platform --- sky/services/vsync/ios/vsync_provider_impl.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sky/services/vsync/ios/vsync_provider_impl.mm b/sky/services/vsync/ios/vsync_provider_impl.mm index b4787615673..032c67b5b20 100644 --- a/sky/services/vsync/ios/vsync_provider_impl.mm +++ b/sky/services/vsync/ios/vsync_provider_impl.mm @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "sky/services/vsync/ios/vsync_provider_impl.h" +#include "base/trace_event/trace_event.h" #include #include @@ -25,6 +26,7 @@ static inline uint64_t CurrentTimeMicrosSeconds() { @implementation VSyncClient { CADisplayLink* _displayLink; ::vsync::VSyncProvider::AwaitVSyncCallback _pendingCallback; + BOOL _traceLevel; } - (instancetype)init { @@ -48,6 +50,7 @@ static inline uint64_t CurrentTimeMicrosSeconds() { } - (void)onDisplayLink:(CADisplayLink*)link { + TRACE_COUNTER1("vsync", "PlatformVSync", _traceLevel = !_traceLevel); _displayLink.paused = YES; _pendingCallback.Run(CurrentTimeMicrosSeconds()); }