#include <FlutterTracing.h>
Instance Methods | |
| (instancetype) | - NS_UNAVAILABLE |
Class Methods | |
| (void) | + tracePlatformVsyncWithStartTime:targetTime: |
| (void) | + traceAsyncBegin:eventID: |
| (void) | + traceAsyncEnd:eventID: |
| (void) | + beginSection: |
| (void) | + endSection: |
Provides utility methods to record tracing events to the Flutter timeline.
This class wraps the C++ fml/trace_event.h macros, exposing them as Objective-C methods. It is used to instrument Objective-C and Swift code with duration events, asynchronous events, and custom flow events.
Events recorded are sent to the Dart VM timeline and can be visualized using Flutter DevTools.
In Swift, this class is available as Tracing.
Definition at line 25 of file FlutterTracing.h.
| + (void) beginSection: | (NSString*) | name |
Starts a thread-local manual tracing section.
This is a low-level API. In Swift code, consider using Tracing.withTrace or Tracing.beginScope which are safer and more idiomatic.
Every call to beginSection: must be paired with a corresponding call to endSection: with the matching name on the same thread.
| name | The name of the tracing section. |
Definition at line 10 of file FlutterTracing.mm.
References TRACE_EVENT2_INT.
| + (void) endSection: | (NSString*) | name |
Ends a thread-local manual tracing section.
This must be called to end a section started by beginSection: with the matching name.
| name | The name of the tracing section. |
Definition at line 10 of file FlutterTracing.mm.
| - (instancetype) NS_UNAVAILABLE |
| + (void) traceAsyncBegin: | (NSString*) | name | |
| eventID: | (int64_t) | eventID | |
Traces the beginning of an asynchronous event.
Asynchronous events are used to trace operations that span multiple threads or are not bound to a single scope. Corresponding begin and end events must have matching names and event IDs.
| name | The name of the event. |
| eventID | A unique identifier used to associate this begin event with its corresponding end event. |
Definition at line 10 of file FlutterTracing.mm.
| + (void) traceAsyncEnd: | (NSString*) | name | |
| eventID: | (int64_t) | eventID | |
Traces the end of an asynchronous event.
Asynchronous events are used to trace operations that span multiple threads or are not bound to a single scope. Corresponding begin and end events must have matching names and event IDs.
| name | The name of the event. |
| eventID | A unique identifier used to associate this end event with its corresponding begin event. |
Definition at line 10 of file FlutterTracing.mm.
| + (void) tracePlatformVsyncWithStartTime: | (NSTimeInterval) | startTime | |
| targetTime: | (NSTimeInterval) | targetTime | |
Traces a platform vsync event with the given start and target times.
This method is used to instrument platform-specific vsync signals. It records the frame start time and target time to the timeline, converted to microseconds.
| startTime | The start time of the vsync tick. |
| targetTime | The target time of the next vsync tick. |
Definition at line 10 of file FlutterTracing.mm.