4#ifndef SkTraceEventCommon_DEFINED
5#define SkTraceEventCommon_DEFINED
56#if defined(TRACE_EVENT0)
57 #error "Another copy of this file has already been included."
93#ifdef SK_ANDROID_FRAMEWORK_USE_PERFETTO
100#define PERFETTO_TRACK_EVENT_NAMESPACE skia
101#include <perfetto/tracing.h>
103#include <cutils/trace.h>
105#include <string_view>
123 perfetto::Category(
"GM"),
124 perfetto::Category(
"skia"),
125 perfetto::Category(
"skia.android"),
126 perfetto::Category(
"skia.gpu"),
127 perfetto::Category(
"skia.gpu.cache"),
128 perfetto::Category(
"skia.objects"),
129 perfetto::Category(
"skia.shaders"),
130 perfetto::Category(
"skottie"),
131 perfetto::Category(
"test"),
132 perfetto::Category(
"test_cpu"),
133 perfetto::Category(
"test_ganesh"),
134 perfetto::Category(
"test_graphite"),
136 perfetto::Category(
"GM.always").SetTags(
"skia.always"),
137 perfetto::Category(
"skia.always").SetTags(
"skia.always"),
138 perfetto::Category(
"skia.android.always").SetTags(
"skia.always"),
139 perfetto::Category(
"skia.gpu.always").SetTags(
"skia.always"),
140 perfetto::Category(
"skia.gpu.cache.always").SetTags(
"skia.always"),
141 perfetto::Category(
"skia.objects.always").SetTags(
"skia.always"),
142 perfetto::Category(
"skia.shaders.always").SetTags(
"skia.always"),
143 perfetto::Category(
"skottie.always").SetTags(
"skia.always"),
144 perfetto::Category(
"test.always").SetTags(
"skia.always"),
145 perfetto::Category(
"test_cpu.always").SetTags(
"skia.always"),
146 perfetto::Category(
"test_ganesh.always").SetTags(
"skia.always"),
147 perfetto::Category(
"test_graphite.always").SetTags(
"skia.always"),
152#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
154#ifdef SK_DISABLE_TRACING
155#error SK_DISABLE_TRACING and SK_BUILD_FOR_ANDROID_FRAMEWORK are mutually exclusive.
158#define SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE 256
160class SkAndroidFrameworkTraceUtil {
162 SkAndroidFrameworkTraceUtil() =
delete;
171 static void setEnableTracing(
bool enableAndroidTracing) {
172 gEnableAndroidTracing = enableAndroidTracing;
178 static bool setUsePerfettoTrackEvents(
bool usePerfettoTrackEvents) {
179#ifdef SK_ANDROID_FRAMEWORK_USE_PERFETTO
181 if (!gUsePerfettoTrackEvents && usePerfettoTrackEvents) {
184 gUsePerfettoTrackEvents = usePerfettoTrackEvents;
188 SkDebugf(
"Tracing Skia with Perfetto is not supported in this environment (host build?)");
193 static bool getEnableTracing() {
194 return gEnableAndroidTracing;
197 static bool getUsePerfettoTrackEvents() {
198 return gUsePerfettoTrackEvents;
202 static bool gEnableAndroidTracing;
203 static bool gUsePerfettoTrackEvents;
205#ifdef SK_ANDROID_FRAMEWORK_USE_PERFETTO
209 static void initPerfetto() {
210 ::perfetto::TracingInitArgs perfettoArgs;
211 perfettoArgs.backends |= perfetto::kSystemBackend;
221static inline
void skprintf_like_noop(const
char format[], ...) {}
222template <
typename... Args>
223static inline void sk_noop(Args...) {}
224#define TRACE_EMPTY(...) do { sk_noop(__VA_ARGS__); } while (0)
225#define TRACE_EMPTY_FMT(fmt, ...) do { skprintf_like_noop(fmt, ##__VA_ARGS__); } while (0)
227#define TRACE_EMPTY(...) do {} while (0)
228#define TRACE_EMPTY_FMT(fmt, ...) do {} while (0)
231#if defined(SK_DISABLE_TRACING) || \
232 (defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && !defined(SK_ANDROID_FRAMEWORK_USE_PERFETTO))
234 #define ATRACE_ANDROID_FRAMEWORK(fmt, ...) TRACE_EMPTY_FMT(fmt, ##__VA_ARGS__)
235 #define ATRACE_ANDROID_FRAMEWORK_ALWAYS(fmt, ...) TRACE_EMPTY_FMT(fmt, ##__VA_ARGS__)
236 #define TRACE_EVENT0(cg, n) TRACE_EMPTY(cg, n)
237 #define TRACE_EVENT1(cg, n, a1n, a1v) TRACE_EMPTY(cg, n, a1n, a1v)
238 #define TRACE_EVENT2(cg, n, a1n, a1v, a2n, a2v) TRACE_EMPTY(cg, n, a1n, a1v, a2n, a2v)
239 #define TRACE_EVENT0_ALWAYS(cg, n) TRACE_EMPTY(cg, n)
240 #define TRACE_EVENT1_ALWAYS(cg, n, a1n, a1v) TRACE_EMPTY(cg, n, a1n, a1v)
241 #define TRACE_EVENT2_ALWAYS(cg, n, a1n, a1v, a2n, a2v) TRACE_EMPTY(cg, n, a1n, a1v, a2n, a2v)
242 #define TRACE_EVENT_INSTANT0(cg, n, scope) TRACE_EMPTY(cg, n, scope)
243 #define TRACE_EVENT_INSTANT1(cg, n, scope, a1n, a1v) TRACE_EMPTY(cg, n, scope, a1n, a1v)
244 #define TRACE_EVENT_INSTANT2(cg, n, scope, a1n, a1v, a2n, a2v) \
245 TRACE_EMPTY(cg, n, scope, a1n, a1v, a2n, a2v)
246 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(cg, n, id) TRACE_EMPTY(cg, n, id)
247 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(cg, n, id, ss) TRACE_EMPTY(cg, n, id, ss)
248 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(cg, n, id) TRACE_EMPTY(cg, n, id)
249 #define TRACE_COUNTER1(cg, n, value) TRACE_EMPTY(cg, n, value)
250 #define TRACE_COUNTER2(cg, n, v1n, v1v, v2n, v2v) TRACE_EMPTY(cg, n, v1n, v1v, v2n, v2v)
252#elif defined(SK_ANDROID_FRAMEWORK_USE_PERFETTO)
258 inline const char* UnboxPerfettoString(const ::perfetto::DynamicString& str) {
261 inline const char* UnboxPerfettoString(const ::perfetto::StaticString& str) {
264 inline const char* UnboxPerfettoString(
const char* str) {
274 inline std::string WrapTraceArgInStdString(
const T numeric) {
277 inline std::string WrapTraceArgInStdString(const ::perfetto::DynamicString& str) {
278 return std::string(str.value);
280 inline std::string WrapTraceArgInStdString(const ::perfetto::StaticString& str) {
281 return std::string(str.value);
283 inline std::string WrapTraceArgInStdString(
const char* str) {
284 return std::string(str);
287 constexpr bool StrEndsWithAndLongerThan(
const char* str,
const char*
suffix) {
288 auto strView = std::basic_string_view(str);
289 auto suffixView = std::basic_string_view(
suffix);
291 return strView.size() > suffixView.size() &&
292 strView.compare(strView.size() - suffixView.size(),
293 std::string_view::npos, suffixView) == 0;
300#define SK_PERFETTO_INTERNAL_CONCAT2(a, b) a##b
301#define SK_PERFETTO_INTERNAL_CONCAT(a, b) SK_PERFETTO_INTERNAL_CONCAT2(a, b)
302#define SK_PERFETTO_UID(prefix) SK_PERFETTO_INTERNAL_CONCAT(prefix, __LINE__)
308#define SK_INTERNAL_GET_ATRACE_ARGS_MACRO(_0, _1a, _1b, _2a, _2b, macro_name, ...) macro_name
310#define SK_INTERNAL_ATRACE_ARGS_BEGIN_0(name) \
311 ATRACE_BEGIN(::skia_private::UnboxPerfettoString(name));
313#define SK_INTERNAL_ATRACE_ARGS_BEGIN_1(name, arg1_name, arg1_val) \
314 char SK_PERFETTO_UID(skTraceStrBuf1)[SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE]; \
315 snprintf(SK_PERFETTO_UID(skTraceStrBuf1), \
316 SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE, \
318 ::skia_private::UnboxPerfettoString(arg1_name), \
319 ::skia_private::WrapTraceArgInStdString(arg1_val).c_str()); \
320 ATRACE_BEGIN(::skia_private::UnboxPerfettoString(name)); \
321 ATRACE_BEGIN(SK_PERFETTO_UID(skTraceStrBuf1));
323#define SK_INTERNAL_ATRACE_ARGS_BEGIN_2( \
324 name, arg1_name, arg1_val, arg2_name, arg2_val, ...) \
325 char SK_PERFETTO_UID(skTraceStrBuf1)[SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE]; \
326 char SK_PERFETTO_UID(skTraceStrBuf2)[SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE]; \
327 snprintf(SK_PERFETTO_UID(skTraceStrBuf1), \
328 SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE, \
330 ::skia_private::UnboxPerfettoString(arg1_name), \
331 ::skia_private::WrapTraceArgInStdString(arg1_val).c_str()); \
332 snprintf(SK_PERFETTO_UID(skTraceStrBuf2), \
333 SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE, \
335 ::skia_private::UnboxPerfettoString(arg2_name), \
336 ::skia_private::WrapTraceArgInStdString(arg2_val).c_str()); \
337 ATRACE_BEGIN(::skia_private::UnboxPerfettoString(name)); \
338 ATRACE_BEGIN(SK_PERFETTO_UID(skTraceStrBuf1)); \
339 ATRACE_BEGIN(SK_PERFETTO_UID(skTraceStrBuf2));
344#define SK_INTERNAL_ATRACE_ARGS_BEGIN(slice_name, ...) \
345 SK_INTERNAL_GET_ATRACE_ARGS_MACRO(0, \
347 SK_INTERNAL_ATRACE_ARGS_BEGIN_2, \
349 SK_INTERNAL_ATRACE_ARGS_BEGIN_1, \
351 SK_INTERNAL_ATRACE_ARGS_BEGIN_0) \
352 (slice_name, ##__VA_ARGS__)
354#define SK_INTERNAL_ATRACE_ARGS_END_2(arg1_name, arg1_val, arg2_name, arg2_val, ...) \
359#define SK_INTERNAL_ATRACE_ARGS_END_1(arg1_name, arg1_val) \
363#define SK_INTERNAL_ATRACE_ARGS_END_0() \
369#define SK_INTERNAL_ATRACE_ARGS_END(...) \
370 SK_INTERNAL_GET_ATRACE_ARGS_MACRO(0, \
372 SK_INTERNAL_ATRACE_ARGS_END_2, \
374 SK_INTERNAL_ATRACE_ARGS_END_1, \
376 SK_INTERNAL_ATRACE_ARGS_END_0) \
391#define TRACE_EVENT_ATRACE_OR_PERFETTO_FORCEABLE(force_always_trace, category, name, ...) \
392 struct SK_PERFETTO_UID(ScopedEvent) { \
393 struct EventFinalizer { \
401 EventFinalizer(...) {} \
402 ~EventFinalizer() { \
403 if (force_always_trace || \
404 CC_UNLIKELY(SkAndroidFrameworkTraceUtil::getEnableTracing())) { \
405 if (SkAndroidFrameworkTraceUtil::getUsePerfettoTrackEvents()) { \
406 TRACE_EVENT_END(category); \
408 SK_INTERNAL_ATRACE_ARGS_END(__VA_ARGS__); \
413 EventFinalizer(const EventFinalizer&) = delete; \
414 EventFinalizer& operator=(const EventFinalizer&) = delete; \
416 EventFinalizer(EventFinalizer&&) = default; \
417 EventFinalizer& operator=(EventFinalizer&&) = delete; \
419 } SK_PERFETTO_UID(scoped_event) { \
421 static_assert(!force_always_trace || \
422 ::skia_private::StrEndsWithAndLongerThan(category, ".always"), \
423 "[force_always_trace == true] requires [category] to end in '.always'"); \
424 if (force_always_trace || \
425 CC_UNLIKELY(SkAndroidFrameworkTraceUtil::getEnableTracing())) { \
426 if (SkAndroidFrameworkTraceUtil::getUsePerfettoTrackEvents()) { \
427 TRACE_EVENT_BEGIN(category, name, ##__VA_ARGS__); \
429 SK_INTERNAL_ATRACE_ARGS_BEGIN(name, ##__VA_ARGS__); \
438#define TRACE_EVENT_ATRACE_OR_PERFETTO(category, name, ...) \
439 TRACE_EVENT_ATRACE_OR_PERFETTO_FORCEABLE( \
440 false, category, name, ##__VA_ARGS__)
447#define ATRACE_ANDROID_FRAMEWORK(fmt, ...) \
448 char SK_PERFETTO_UID(skTraceStrBuf)[SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE]; \
449 if (SkAndroidFrameworkTraceUtil::getEnableTracing()) { \
450 snprintf(SK_PERFETTO_UID(skTraceStrBuf), SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE, \
451 fmt, ##__VA_ARGS__); \
453 TRACE_EVENT0("skia.android", TRACE_STR_COPY(SK_PERFETTO_UID(skTraceStrBuf)))
460#define ATRACE_ANDROID_FRAMEWORK_ALWAYS(fmt, ...) \
461 char SK_PERFETTO_UID(skTraceStrBuf)[SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE]; \
462 snprintf(SK_PERFETTO_UID(skTraceStrBuf), SK_ANDROID_FRAMEWORK_ATRACE_BUFFER_SIZE, \
463 fmt, ##__VA_ARGS__); \
464 TRACE_EVENT0_ALWAYS("skia.android", TRACE_STR_COPY(SK_PERFETTO_UID(skTraceStrBuf)))
472#define TRACE_EVENT0(category_group, name) \
473 TRACE_EVENT_ATRACE_OR_PERFETTO(category_group, name)
474#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \
475 TRACE_EVENT_ATRACE_OR_PERFETTO(category_group, name, arg1_name, arg1_val)
476#define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \
477 TRACE_EVENT_ATRACE_OR_PERFETTO(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)
485#define TRACE_EVENT0_ALWAYS(category_group, name) \
486 TRACE_EVENT_ATRACE_OR_PERFETTO_FORCEABLE( \
487 true, category_group ".always", name)
488#define TRACE_EVENT1_ALWAYS(category_group, name, arg1_name, arg1_val) \
489 TRACE_EVENT_ATRACE_OR_PERFETTO_FORCEABLE( \
490 true, category_group ".always", name, arg1_name, arg1_val)
491#define TRACE_EVENT2_ALWAYS(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \
492 TRACE_EVENT_ATRACE_OR_PERFETTO_FORCEABLE( true, \
493 category_group ".always", \
503#define TRACE_EVENT_INSTANT0(category_group, name, scope) \
504 do { TRACE_EVENT_ATRACE_OR_PERFETTO(category_group, name); } while(0)
506#define TRACE_EVENT_INSTANT1(category_group, name, scope, arg1_name, arg1_val) \
507 do { TRACE_EVENT_ATRACE_OR_PERFETTO(category_group, name, arg1_name, arg1_val); } while(0)
509#define TRACE_EVENT_INSTANT2(category_group, name, scope, arg1_name, arg1_val, \
510 arg2_name, arg2_val) \
511 do { TRACE_EVENT_ATRACE_OR_PERFETTO(category_group, name, arg1_name, arg1_val, \
512 arg2_name, arg2_val); } while(0)
516#define TRACE_COUNTER1(category_group, name, value) \
517 if (CC_UNLIKELY(SkAndroidFrameworkTraceUtil::getEnableTracing())) { \
518 if (SkAndroidFrameworkTraceUtil::getUsePerfettoTrackEvents()) { \
519 TRACE_COUNTER(category_group, name, value); \
521 ATRACE_INT(name, value); \
528#define TRACE_COUNTER2(category_group, name, value1_name, value1_val, value2_name, value2_val) \
529 if (CC_UNLIKELY(SkAndroidFrameworkTraceUtil::getEnableTracing())) { \
530 if (SkAndroidFrameworkTraceUtil::getUsePerfettoTrackEvents()) { \
531 TRACE_COUNTER(category_group, name "-" value1_name, value1_val); \
532 TRACE_COUNTER(category_group, name "-" value2_name, value2_val); \
534 ATRACE_INT(name "-" value1_name, value1_val); \
535 ATRACE_INT(name "-" value2_name, value2_val); \
541#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \
542 TRACE_EMPTY(category_group, name, id)
543#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, snapshot) \
544 TRACE_EMPTY(category_group, name, id, snapshot)
545#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \
546 TRACE_EMPTY(category_group, name, id)
550#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \
551 if (CC_UNLIKELY(SkAndroidFrameworkTraceUtil::getEnableTracing() && \
552 SkAndroidFrameworkTraceUtil::getUsePerfettoTrackEvents)) { \
553 *ret = TRACE_EVENT_CATEGORY_ENABLED(category_group); \
560#define ATRACE_ANDROID_FRAMEWORK(fmt, ...) TRACE_EMPTY_FMT(fmt, ##__VA_ARGS__)
561#define ATRACE_ANDROID_FRAMEWORK_ALWAYS(fmt, ...) TRACE_EMPTY_FMT(fmt, ##__VA_ARGS__)
565#define TRACE_EVENT0(category_group, name) \
566 INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name)
568#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \
569 INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val)
571#define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \
572 INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)
574#define TRACE_EVENT0_ALWAYS(category_group, name) \
575 INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name)
577#define TRACE_EVENT1_ALWAYS(category_group, name, arg1_name, arg1_val) \
578 INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val)
580#define TRACE_EVENT2_ALWAYS(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \
581 INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)
585#define TRACE_EVENT_INSTANT0(category_group, name, scope) \
586 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
587 TRACE_EVENT_FLAG_NONE | scope)
589#define TRACE_EVENT_INSTANT1(category_group, name, scope, arg1_name, arg1_val) \
590 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
591 TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val)
593#define TRACE_EVENT_INSTANT2(category_group, name, scope, arg1_name, arg1_val, \
594 arg2_name, arg2_val) \
595 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
596 TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val, \
601#define TRACE_COUNTER1(category_group, name, value) \
602 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
603 TRACE_EVENT_FLAG_NONE, "value", \
604 static_cast<int>(value))
609#define TRACE_COUNTER2(category_group, name, value1_name, value1_val, \
610 value2_name, value2_val) \
611 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
612 TRACE_EVENT_FLAG_NONE, value1_name, \
613 static_cast<int>(value1_val), value2_name, \
614 static_cast<int>(value2_val))
616#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \
617 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
618 TRACE_EVENT_PHASE_ASYNC_BEGIN, category, name, id, TRACE_EVENT_FLAG_NONE)
619#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \
620 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
621 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
622#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \
623 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
624 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
626#define TRACE_EVENT_ASYNC_END0(category, name, id) \
627 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
628 category, name, id, TRACE_EVENT_FLAG_NONE)
629#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \
630 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
631 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
632#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \
633 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
634 category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
637#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \
638 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
639 TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, id, \
640 TRACE_EVENT_FLAG_NONE)
642#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \
644 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
645 TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \
646 id, TRACE_EVENT_FLAG_NONE, "snapshot", snapshot)
648#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \
649 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
650 TRACE_EVENT_PHASE_DELETE_OBJECT, category_group, name, id, \
651 TRACE_EVENT_FLAG_NONE)
654#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \
656 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
657 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
667#define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0))
668#define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0))
669#define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1))
670#define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2))
671#define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3))
672#define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4))
673#define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5))
674#define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6))
675#define TRACE_EVENT_FLAG_BIND_TO_ENCLOSING (static_cast<unsigned int>(1 << 7))
676#define TRACE_EVENT_FLAG_FLOW_IN (static_cast<unsigned int>(1 << 8))
677#define TRACE_EVENT_FLAG_FLOW_OUT (static_cast<unsigned int>(1 << 9))
678#define TRACE_EVENT_FLAG_HAS_CONTEXT_ID (static_cast<unsigned int>(1 << 10))
680#define TRACE_EVENT_FLAG_SCOPE_MASK \
681 (static_cast<unsigned int>(TRACE_EVENT_FLAG_SCOPE_OFFSET | \
682 TRACE_EVENT_FLAG_SCOPE_EXTRA))
685#define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1))
686#define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2))
687#define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3))
688#define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4))
689#define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5))
690#define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6))
691#define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7))
692#define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8))
695#define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3))
696#define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3))
697#define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3))
699#define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
700#define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
701#define TRACE_EVENT_SCOPE_NAME_THREAD ('t')
#define SK_PRINTF_LIKE(A, B)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
PERFETTO_DEFINE_CATEGORIES()
uint32_t uint32_t * format
void Initialize(zx::channel directory_request, std::optional< zx::eventpair > view_ref)
Initializes Dart bindings for the Fuchsia application model.
static SkString to_string(int n)