12#ifdef SK_BUILD_FOR_ANDROID
16#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
17 #include <cutils/trace.h>
22#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
23 fIsEnabled = []{
return static_cast<bool>(CC_UNLIKELY(ATRACE_ENABLED())); };
24 fBeginSection = [](
const char*
name){ ATRACE_BEGIN(
name); };
25 fEndSection = []{ ATRACE_END(); };
26#elif defined(SK_BUILD_FOR_ANDROID)
27 if (
void* lib = dlopen(
"libandroid.so", RTLD_NOW | RTLD_LOCAL)) {
28 fBeginSection = (
decltype(fBeginSection))dlsym(lib,
"ATrace_beginSection");
29 fEndSection = (
decltype(fEndSection))dlsym(lib,
"ATrace_endSection");
30 fIsEnabled = (
decltype(fIsEnabled))dlsym(lib,
"ATrace_isEnabled");
35 fIsEnabled = []{
return false; };
40 const uint8_t* categoryEnabledFlag,
44 const char** argNames,
45 const uint8_t* argTypes,
46 const uint64_t* argValues,
79#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
81bool SkAndroidFrameworkTraceUtil::gEnableAndroidTracing =
false;
82bool SkAndroidFrameworkTraceUtil::gUsePerfettoTrackEvents =
false;
#define TRACE_EVENT_PHASE_INSTANT
#define TRACE_EVENT_PHASE_COMPLETE
SkEventTracer::Handle addTraceEvent(char phase, const uint8_t *categoryEnabledFlag, const char *name, uint64_t id, int numArgs, const char **argNames, const uint8_t *argTypes, const uint64_t *argValues, uint8_t flags) override
const uint8_t * getCategoryGroupEnabled(const char *name) override
void updateTraceEventDuration(const uint8_t *categoryEnabledFlag, const char *name, SkEventTracer::Handle handle) override
@ kEnabledForRecording_CategoryGroupEnabledFlags
FlutterSemanticsFlag flags
DEF_SWITCHES_START aot vmservice shared library name