Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
EventTracingPriv.cpp File Reference
#include "tools/trace/EventTracingPriv.h"
#include "include/utils/SkEventTracer.h"
#include "src/core/SkATrace.h"
#include "src/core/SkTraceEvent.h"
#include "tools/flags/CommandLineFlags.h"
#include "tools/trace/ChromeTracingTracer.h"
#include "tools/trace/SkDebugfTracer.h"

Go to the source code of this file.

Functions

static DEFINE_string (trace, "", "Log trace events in one of several modes:\n" " debugf : Show events using SkDebugf\n" " atrace : Send events to Android ATrace\n" " perfetto : Send events to Perfetto (Linux, Android, and Mac only)\n" " <filename> : Any other string is interpreted as a filename. Writes\n" " trace events to specified file as JSON, for viewing\n" " with chrome://tracing")
 
static DEFINE_string (traceMatch, "", "Filter which categories are traced.\n" "Uses same format as --match\n")
 
void initializeEventTracingForTools (const char *traceFlag)
 

Function Documentation

◆ DEFINE_string() [1/2]

static DEFINE_string ( trace  ,
""  ,
"Log trace events in one of several modes:\n" " debugf : Show events using SkDebugf\n" " atrace : Send events to Android ATrace\n" " perfetto : Send events to Perfetto (Linux, Android, and Mac only)\n" " <filename> : Any other string is interpreted as a filename. Writes\n" " trace events to specified file as  JSON,
for viewing\n" " with chrome://tracing"   
)
static

◆ DEFINE_string() [2/2]

static DEFINE_string ( traceMatch  ,
""  ,
"Filter which categories are traced.\n" "Uses same format as --match\n"   
)
static

◆ initializeEventTracingForTools()

void initializeEventTracingForTools ( const char *  mode = nullptr)

Construct and install an SkEventTracer, based on the mode, defaulting to the –trace command line argument.

Definition at line 44 of file EventTracingPriv.cpp.

44 {
45 if (!traceFlag) {
46 if (FLAGS_trace.isEmpty()) {
47 return;
48 }
49 traceFlag = FLAGS_trace[0];
50 }
51
52 SkEventTracer* eventTracer = nullptr;
53 if (0 == strcmp(traceFlag, "atrace")) {
54 eventTracer = new SkATrace();
55 } else if (0 == strcmp(traceFlag, "debugf")) {
56 eventTracer = new SkDebugfTracer();
57 } else if (0 == strcmp(traceFlag, "perfetto")) {
58 #if defined(SK_USE_PERFETTO)
59 eventTracer = new SkPerfettoTrace();
60 #else
61 // TODO(b/259248961): update this explanation (and associated docs) as the Perfetto
62 // transition progresses.
63 SkDebugf("Perfetto is not enabled (SK_USE_PERFETTO is false). Perfetto tracing will not "
64 "be performed.\nTracing tools with Perfetto is only enabled for Linux, Android, "
65 "and Mac.\n");
66 return;
67 #endif
68 }
69 else {
70 eventTracer = new ChromeTracingTracer(traceFlag);
71 }
72
74}
#define SkAssertResult(cond)
Definition SkAssert.h:123
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static bool SetInstance(SkEventTracer *, bool leakTracer=false)