Flutter macOS Embedder
FlutterTracing.mm
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include "flutter/fml/trace_event.h"
9 
11 
12 @implementation FlutterTracing
13 
14 + (void)tracePlatformVsyncWithStartTime:(NSTimeInterval)startTime
15  targetTime:(NSTimeInterval)targetTime {
16  int64_t startTimeMicroseconds = (int64_t)(startTime * 1000000);
17  int64_t targetTimeMicroseconds = (int64_t)(targetTime * 1000000);
18  TRACE_EVENT2_INT("flutter", "PlatformVsync", "frame_start_time", startTimeMicroseconds,
19  "frame_target_time", targetTimeMicroseconds);
20 }
21 
22 + (void)traceAsyncBegin:(NSString*)name eventID:(int64_t)eventID {
23  TRACE_EVENT_ASYNC_BEGIN0("flutter", [name UTF8String] ?: "", eventID);
24 }
25 
26 + (void)traceAsyncEnd:(NSString*)name eventID:(int64_t)eventID {
27  TRACE_EVENT_ASYNC_END0("flutter", [name UTF8String] ?: "", eventID);
28 }
29 
30 + (void)beginSection:(NSString*)name {
31  ::fml::tracing::TraceEvent0("flutter", [name UTF8String] ?: "", 0, nullptr);
32 }
33 
34 + (void)endSection:(NSString*)name {
35  ::fml::tracing::TraceEventEnd([name UTF8String] ?: "");
36 }
37 
38 @end
#define FLUTTER_ASSERT_ARC
Definition: FlutterMacros.h:44