21#if defined(SK_USE_PERFETTO)
22 #if defined(SK_ANDROID_FRAMEWORK_USE_PERFETTO)
23 #error "SK_USE_PERFETTO and SK_ANDROID_FRAMEWORK_USE_PERFETTO are mutually exclusive"
31 "Log trace events in one of several modes:\n"
32 " debugf : Show events using SkDebugf\n"
33 " atrace : Send events to Android ATrace\n"
34 " perfetto : Send events to Perfetto (Linux, Android, and Mac only)\n"
35 " <filename> : Any other string is interpreted as a filename. Writes\n"
36 " trace events to specified file as JSON, for viewing\n"
37 " with chrome://tracing");
41 "Filter which categories are traced.\n"
42 "Uses same format as --match\n");
46 if (FLAGS_trace.isEmpty()) {
49 traceFlag = FLAGS_trace[0];
53 if (0 == strcmp(traceFlag,
"atrace")) {
55 }
else if (0 == strcmp(traceFlag,
"debugf")) {
57 }
else if (0 == strcmp(traceFlag,
"perfetto")) {
58 #if defined(SK_USE_PERFETTO)
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, "
77 static_assert(0 == offsetof(CategoryState, fEnabled),
"CategoryState");
88 for (
int i = 0;
i < fNumCategories; ++
i) {
90 return reinterpret_cast<uint8_t*
>(&fCategories[
i]);
94 if (fNumCategories >= kMaxCategories) {
95 SkDEBUGFAIL(
"Exhausted event tracing categories. Increase kMaxCategories.");
96 return reinterpret_cast<uint8_t*
>(&fCategories[0]);
99 fCategories[fNumCategories].fEnabled =
104 fCategories[fNumCategories].fName =
name;
105 return reinterpret_cast<uint8_t*
>(&fCategories[fNumCategories++]);
109 if (categoryEnabledFlag) {
110 return reinterpret_cast<const CategoryState*
>(categoryEnabledFlag)->
fName;
void initializeEventTracingForTools(const char *traceFlag)
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")
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
#define SkDEBUGFAIL(message)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static bool SkStrStartsWith(const char string[], const char prefixStr[])
#define TRACE_CATEGORY_PREFIX
static bool ShouldSkip(const SkTDArray< const char * > &strings, const char *name)
static bool SetInstance(SkEventTracer *, bool leakTracer=false)
@ kEnabledForRecording_CategoryGroupEnabledFlags
const char * getCategoryGroupName(const uint8_t *categoryEnabledFlag)
uint8_t * getCategoryGroupEnabled(const char *name)
DEF_SWITCHES_START aot vmservice shared library name