Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions | Variables
SkTraceEvent.h File Reference
#include "include/utils/SkEventTracer.h"
#include "src/base/SkUtils.h"
#include "src/core/SkTraceEventCommon.h"
#include <atomic>

Go to the source code of this file.

Classes

class  skia_private::TraceID
 
class  skia_private::TraceStringWithCopy
 
class  skia_private::ScopedTracer
 

Namespaces

namespace  skia_private
 

Macros

#define TRACE_FUNC   __PRETTY_FUNCTION__
 
#define TRACE_STR_COPY(str)   (::skia_private::TraceStringWithCopy(str))
 
#define TRACE_STR_STATIC(str)   (str)
 
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
 
#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED    SkEventTracer::GetInstance()->getCategoryGroupEnabled
 
#define TRACE_EVENT_API_ADD_TRACE_EVENT    SkEventTracer::GetInstance()->addTraceEvent
 
#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION    SkEventTracer::GetInstance()->updateTraceEventDuration
 
#define TRACE_EVENT_API_NEW_TRACE_SECTION    SkEventTracer::GetInstance()->newTracingSection
 
#define TRACE_EVENT_API_CLASS_EXPORT   SK_API
 
#define TRACE_CATEGORY_PREFIX   "disabled-by-default-"
 
#define INTERNAL_TRACE_EVENT_UID3(a, b)    trace_event_unique_##a##b
 
#define INTERNAL_TRACE_EVENT_UID2(a, b)    INTERNAL_TRACE_EVENT_UID3(a,b)
 
#define INTERNAL_TRACE_EVENT_UID(name_prefix)    INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
 
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES(category_group, atomic, category_group_enabled)
 
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)
 
#define INTERNAL_TRACE_EVENT_ADD(phase, category_group, name, flags, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category_group, name, id, flags, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, ...)
 

Functions

template<typename T >
static void skia_private::SetTraceValue (const T &arg, unsigned char *type, uint64_t *value)
 
static const char * skia_private::TraceValueAsString (uint64_t value)
 
static const void * skia_private::TraceValueAsPointer (uint64_t value)
 
static SkEventTracer::Handle skia_private::AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags)
 
template<class ARG1_TYPE >
static SkEventTracer::Handle skia_private::AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags, const char *arg1_name, const ARG1_TYPE &arg1_val)
 
template<class ARG1_TYPE , class ARG2_TYPE >
static SkEventTracer::Handle skia_private::AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags, const char *arg1_name, const ARG1_TYPE &arg1_val, const char *arg2_name, const ARG2_TYPE &arg2_val)
 

Variables

const int skia_private::kZeroNumArgs = 0
 
const uint64_t skia_private::kNoEventId = 0
 

Macro Definition Documentation

◆ INTERNAL_TRACE_EVENT_ADD

#define INTERNAL_TRACE_EVENT_ADD (   phase,
  category_group,
  name,
  flags,
  ... 
)
Value:
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
skia_private::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
skia_private::kNoEventId, flags, ##__VA_ARGS__); \
} \
} while (0)
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
FlutterSemanticsFlag flags
const char * name
Definition fuchsia.cc:50
const uint64_t kNoEventId

Definition at line 166 of file SkTraceEvent.h.

167 { \
168 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
170 skia_private::AddTraceEvent( \
171 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
172 skia_private::kNoEventId, flags, ##__VA_ARGS__); \
173 } \
174 } while (0)

◆ INTERNAL_TRACE_EVENT_ADD_SCOPED

#define INTERNAL_TRACE_EVENT_ADD_SCOPED (   category_group,
  name,
  ... 
)
Value:
do { \
INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \
INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \
INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \
} \
} while (0)
#define TRACE_EVENT_FLAG_NONE
#define TRACE_EVENT_PHASE_COMPLETE
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)
uint64_t Handle
static SkEventTracer::Handle AddTraceEvent(char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags)
SkScalar h

Definition at line 195 of file SkTraceEvent.h.

198 { \
202 INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
204 TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \
205 INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \
206 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \
207 } \
208 } while (0)

◆ INTERNAL_TRACE_EVENT_ADD_WITH_ID

#define INTERNAL_TRACE_EVENT_ADD_WITH_ID (   phase,
  category_group,
  name,
  id,
  flags,
  ... 
)
Value:
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
skia_private::TraceID trace_event_trace_id( \
id, &trace_event_flags); \
skia_private::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
name, trace_event_trace_id.data(), trace_event_flags, \
##__VA_ARGS__); \
} \
} while (0)
#define TRACE_EVENT_FLAG_HAS_ID

Definition at line 178 of file SkTraceEvent.h.

180 { \
181 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
183 unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
184 skia_private::TraceID trace_event_trace_id( \
185 id, &trace_event_flags); \
186 skia_private::AddTraceEvent( \
187 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
188 name, trace_event_trace_id.data(), trace_event_flags, \
189 ##__VA_ARGS__); \
190 } \
191 } while (0)

◆ INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE

#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE ( )

◆ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO

#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO (   category_group)
Value:
static std::atomic<intptr_t> INTERNAL_TRACE_EVENT_UID(atomic){0}; \
const uint8_t* INTERNAL_TRACE_EVENT_UID(category_group_enabled); \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \
TRACE_CATEGORY_PREFIX category_group, \
INTERNAL_TRACE_EVENT_UID(category_group_enabled));
#define TRACE_CATEGORY_PREFIX

Definition at line 156 of file SkTraceEvent.h.

157 {0}; \
158 const uint8_t* INTERNAL_TRACE_EVENT_UID(category_group_enabled); \
159 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \
160 TRACE_CATEGORY_PREFIX category_group, \
161 INTERNAL_TRACE_EVENT_UID(atomic), \
162 INTERNAL_TRACE_EVENT_UID(category_group_enabled));

◆ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES

#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES (   category_group,
  atomic,
  category_group_enabled 
)
Value:
category_group_enabled = \
reinterpret_cast<const uint8_t*>(atomic.load(std::memory_order_relaxed)); \
if (!category_group_enabled) { \
category_group_enabled = TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); \
atomic.store(reinterpret_cast<intptr_t>(category_group_enabled), \
std::memory_order_relaxed); \
}
#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED

Definition at line 146 of file SkTraceEvent.h.

150 { \
151 category_group_enabled = TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); \
152 atomic.store(reinterpret_cast<intptr_t>(category_group_enabled), \
153 std::memory_order_relaxed); \
154 }

◆ INTERNAL_TRACE_EVENT_UID

#define INTERNAL_TRACE_EVENT_UID (   name_prefix)     INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)

Definition at line 140 of file SkTraceEvent.h.

◆ INTERNAL_TRACE_EVENT_UID2

#define INTERNAL_TRACE_EVENT_UID2 (   a,
  b 
)     INTERNAL_TRACE_EVENT_UID3(a,b)

Definition at line 138 of file SkTraceEvent.h.

◆ INTERNAL_TRACE_EVENT_UID3

#define INTERNAL_TRACE_EVENT_UID3 (   a,
  b 
)     trace_event_unique_##a##b

Definition at line 136 of file SkTraceEvent.h.

◆ TRACE_CATEGORY_PREFIX

#define TRACE_CATEGORY_PREFIX   "disabled-by-default-"

Definition at line 129 of file SkTraceEvent.h.

◆ TRACE_EVENT_API_ADD_TRACE_EVENT

#define TRACE_EVENT_API_ADD_TRACE_EVENT    SkEventTracer::GetInstance()->addTraceEvent

Definition at line 103 of file SkTraceEvent.h.

◆ TRACE_EVENT_API_CLASS_EXPORT

#define TRACE_EVENT_API_CLASS_EXPORT   SK_API

Definition at line 125 of file SkTraceEvent.h.

◆ TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED

#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED    SkEventTracer::GetInstance()->getCategoryGroupEnabled

Definition at line 89 of file SkTraceEvent.h.

◆ TRACE_EVENT_API_NEW_TRACE_SECTION

#define TRACE_EVENT_API_NEW_TRACE_SECTION    SkEventTracer::GetInstance()->newTracingSection

Definition at line 120 of file SkTraceEvent.h.

◆ TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION

#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION    SkEventTracer::GetInstance()->updateTraceEventDuration

Definition at line 111 of file SkTraceEvent.h.

◆ TRACE_FUNC

#define TRACE_FUNC   __PRETTY_FUNCTION__

Definition at line 30 of file SkTraceEvent.h.

◆ TRACE_STR_COPY

#define TRACE_STR_COPY (   str)    (::skia_private::TraceStringWithCopy(str))

Definition at line 63 of file SkTraceEvent.h.

◆ TRACE_STR_STATIC

#define TRACE_STR_STATIC (   str)    (str)

Definition at line 73 of file SkTraceEvent.h.