v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
trace-event.h File Reference
#include <stddef.h>
#include <memory>
#include "v8config.h"
#include "src/tracing/trace-event-no-perfetto.h"
#include "include/v8-platform.h"
#include "src/base/atomicops.h"
#include "src/base/macros.h"
Include dependency graph for trace-event.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  v8::internal::tracing::TraceEventHelper
 
class  v8::internal::tracing::TraceID
 
class  v8::internal::tracing::TraceID::WithScope
 
class  v8::internal::tracing::TraceStringWithCopy
 
class  v8::internal::tracing::ScopedTracer
 
struct  v8::internal::tracing::ScopedTracer::Data
 

Namespaces

namespace  v8
 
namespace  v8::internal
 
namespace  v8::internal::tracing
 

Macros

#define TRACE_STR_COPY(str)
 
#define TRACE_ID_WITH_SCOPE(scope, id)
 
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
 
#define INTERNAL_TRACE_MEMORY(category, name)
 
#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED
 
#define TRACE_EVENT_API_GET_NUM_TRACES_RECORDED   UNIMPLEMENTED()
 
#define TRACE_EVENT_API_ADD_TRACE_EVENT   v8::internal::tracing::AddTraceEventImpl
 
#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP    v8::internal::tracing::AddTraceEventWithTimestampImpl
 
#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION
 
#define TRACE_EVENT_API_ATOMIC_WORD   v8::base::AtomicWord
 
#define TRACE_EVENT_API_ATOMIC_LOAD(var)
 
#define TRACE_EVENT_API_ATOMIC_STORE(var, value)
 
#define TRACE_EVENT_API_LOAD_CATEGORY_GROUP_ENABLED()
 
#define INTERNAL_TRACE_EVENT_UID3(a, b)
 
#define INTERNAL_TRACE_EVENT_UID2(a, b)
 
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
 
#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_SCOPED(category_group, name, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, flow_flags, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category_group, name, id, flags, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(phase, category_group, name, timestamp, flags, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( phase, category_group, name, id, timestamp, flags, ...)
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( phase, category_group, name, id, thread_id, timestamp, flags, ...)
 
#define TRACE_EVENT_CALL_STATS_SCOPED(isolate, category_group, name)
 
#define INTERNAL_TRACE_EVENT_CALL_STATS_SCOPED(isolate, category_group, name)
 
#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, value_type_id)
 

Enumerations

enum  CategoryGroupEnabledFlags { kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0 , kEnabledForEventCallback_CategoryGroupEnabledFlags = 1 << 2 , kEnabledForETWExport_CategoryGroupEnabledFlags = 1 << 3 }
 

Functions

static V8_INLINE uint64_t v8::internal::tracing::AddTraceEventImpl (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, int32_t num_args, const char **arg_names, const uint8_t *arg_types, const uint64_t *arg_values, unsigned int flags)
 
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEventWithTimestampImpl (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, int32_t num_args, const char **arg_names, const uint8_t *arg_types, const uint64_t *arg_values, unsigned int flags, int64_t timestamp)
 
template<typename T >
requires (std::is_integral<T>::value || std::is_enum<T>::value)
static V8_INLINE void v8::internal::tracing::SetTraceValue (T arg, unsigned char *type, uint64_t *value)
 
 v8::internal::tracing::INTERNAL_DECLARE_SET_TRACE_VALUE (const TraceStringWithCopy &, TRACE_VALUE_TYPE_COPY_STRING) static V8_INLINE void SetTraceValue(ConvertableToTraceFormat *convertable_value
 
template<typename T >
requires std::is_convertible<T*, ConvertableToTraceFormat*>::value
static V8_INLINE void v8::internal::tracing::SetTraceValue (std::unique_ptr< T > ptr, unsigned char *type, uint64_t *value)
 
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags)
 
template<class ARG1_TYPE >
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags, const char *arg1_name, ARG1_TYPE &&arg1_val)
 
template<class ARG1_TYPE , class ARG2_TYPE >
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags, const char *arg1_name, ARG1_TYPE &&arg1_val, const char *arg2_name, ARG2_TYPE &&arg2_val)
 
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEventWithTimestamp (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags, int64_t timestamp)
 
template<class ARG1_TYPE >
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEventWithTimestamp (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags, int64_t timestamp, const char *arg1_name, ARG1_TYPE &&arg1_val)
 
template<class ARG1_TYPE , class ARG2_TYPE >
static V8_INLINE uint64_t v8::internal::tracing::AddTraceEventWithTimestamp (char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags, int64_t timestamp, const char *arg1_name, ARG1_TYPE &&arg1_val, const char *arg2_name, ARG2_TYPE &&arg2_val)
 

Variables

const int v8::internal::tracing::kZeroNumArgs = 0
 
const decltype(nullptr) v8::internal::tracing::kGlobalScope = nullptr
 
const uint64_t v8::internal::tracing::kNoId = 0
 
unsigned char * v8::internal::tracing::type
 
unsigned char uint64_t * v8::internal::tracing::value
 

Macro Definition Documentation

◆ INTERNAL_DECLARE_SET_TRACE_VALUE

#define INTERNAL_DECLARE_SET_TRACE_VALUE ( actual_type,
value_type_id )
Value:
static V8_INLINE void SetTraceValue(actual_type arg, unsigned char* type, \
uint64_t* value) { \
*type = value_type_id; \
*value = 0; \
static_assert(sizeof(arg) <= sizeof(*value)); \
memcpy(value, &arg, sizeof(arg)); \
}
#define V8_INLINE
Definition v8config.h:500

Definition at line 442 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_ADD

#define INTERNAL_TRACE_EVENT_ADD ( phase,
category_group,
name,
flags,
... )
Value:
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
v8::internal::tracing::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
v8::internal::tracing::kNoId, flags, ##__VA_ARGS__); \
} \
} while (false)
const decltype(nullptr) kGlobalScope
const uint64_t kNoId
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
Definition trace-event.h:57
#define INTERNAL_TRACE_EVENT_UID(name_prefix)

Definition at line 181 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_ADD_SCOPED

#define INTERNAL_TRACE_EVENT_ADD_SCOPED ( category_group,
name,
... )
Value:
INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
INTERNAL_TRACE_EVENT_UID(tracer) \
.Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
h); \
}
static V8_INLINE uint64_t AddTraceEvent(char phase, const uint8_t *category_group_enabled, const char *name, const char *scope, uint64_t id, uint64_t bind_id, unsigned int flags)
#define TRACE_EVENT_FLAG_NONE
#define TRACE_EVENT_PHASE_COMPLETE
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)

Definition at line 195 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW

#define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW ( category_group,
name,
bind_id,
flow_flags,
... )
Value:
unsigned int trace_event_flags = flow_flags; \
v8::internal::tracing::TraceID trace_event_bind_id(bind_id, \
&trace_event_flags); \
INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
trace_event_bind_id.raw_id(), trace_event_flags, ##__VA_ARGS__); \
INTERNAL_TRACE_EVENT_UID(tracer) \
.Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
h); \
}

Definition at line 209 of file trace-event.h.

◆ 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 int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
v8::internal::tracing::TraceID trace_event_trace_id(id, \
&trace_event_flags); \
v8::internal::tracing::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \
v8::internal::tracing::kNoId, trace_event_flags, ##__VA_ARGS__); \
} \
} while (false)
#define TRACE_EVENT_FLAG_HAS_ID

Definition at line 229 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP

#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP ( phase,
category_group,
name,
id,
timestamp,
flags,
... )
Value:
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
v8::internal::tracing::TraceID trace_event_trace_id(id, \
&trace_event_flags); \
v8::internal::tracing::AddTraceEventWithTimestamp( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \
v8::internal::tracing::kNoId, trace_event_flags, timestamp, \
##__VA_ARGS__); \
} \
} while (false)

Definition at line 258 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP

#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP ( phase,
category_group,
name,
id,
thread_id,
timestamp,
flags,
... )
Value:
phase, category_group, name, id, timestamp, flags, ##__VA_ARGS__)
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( phase, category_group, name, id, timestamp, flags,...)

Definition at line 277 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP

#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP ( phase,
category_group,
name,
timestamp,
flags,
... )
Value:
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
v8::internal::tracing::AddTraceEventWithTimestamp( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
v8::internal::tracing::kNoId, flags, timestamp, ##__VA_ARGS__); \
} \
} while (false)

Definition at line 245 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_CALL_STATS_SCOPED

#define INTERNAL_TRACE_EVENT_CALL_STATS_SCOPED ( isolate,
category_group,
name )

Definition at line 296 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE

#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE ( )
Value:

Definition at line 57 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO

#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO ( category_group)
Value:
const uint8_t* INTERNAL_TRACE_EVENT_UID(category_group_enabled); \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \
category_group, INTERNAL_TRACE_EVENT_UID(atomic), \
INTERNAL_TRACE_EVENT_UID(category_group_enabled));
#define TRACE_EVENT_API_ATOMIC_WORD

Definition at line 172 of file trace-event.h.

◆ 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*>(TRACE_EVENT_API_ATOMIC_LOAD(atomic)); \
if (!category_group_enabled) { \
category_group_enabled = \
TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); \
TRACE_EVENT_API_ATOMIC_STORE( \
atomic, reinterpret_cast<TRACE_EVENT_API_ATOMIC_WORD>( \
category_group_enabled)); \
}
#define TRACE_EVENT_API_ATOMIC_LOAD(var)

Definition at line 160 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_UID

#define INTERNAL_TRACE_EVENT_UID ( name_prefix)
Value:
INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)
#define INTERNAL_TRACE_EVENT_UID2(a, b)

Definition at line 150 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_UID2

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

Definition at line 149 of file trace-event.h.

◆ INTERNAL_TRACE_EVENT_UID3

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

Definition at line 148 of file trace-event.h.

◆ INTERNAL_TRACE_MEMORY

#define INTERNAL_TRACE_MEMORY ( category,
name )

Definition at line 65 of file trace-event.h.

◆ TRACE_EVENT_API_ADD_TRACE_EVENT

#define TRACE_EVENT_API_ADD_TRACE_EVENT   v8::internal::tracing::AddTraceEventImpl

Definition at line 102 of file trace-event.h.

◆ TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP

#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP    v8::internal::tracing::AddTraceEventWithTimestampImpl

Definition at line 118 of file trace-event.h.

◆ TRACE_EVENT_API_ATOMIC_LOAD

#define TRACE_EVENT_API_ATOMIC_LOAD ( var)
Value:
Atomic8 Acquire_Load(volatile const Atomic8 *ptr)
Definition atomicops.h:249

Definition at line 133 of file trace-event.h.

◆ TRACE_EVENT_API_ATOMIC_STORE

#define TRACE_EVENT_API_ATOMIC_STORE ( var,
value )
Value:
v8::base::Release_Store(&(var), (value))
void Release_Store(volatile Atomic8 *ptr, Atomic8 value)
Definition atomicops.h:204

Definition at line 134 of file trace-event.h.

◆ TRACE_EVENT_API_ATOMIC_WORD

#define TRACE_EVENT_API_ATOMIC_WORD   v8::base::AtomicWord

Definition at line 132 of file trace-event.h.

◆ TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED

#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED
Value:
virtual const uint8_t * GetCategoryGroupEnabled(const char *name)
static V8_EXPORT_PRIVATE v8::TracingController * GetTracingController()

Definition at line 80 of file trace-event.h.

◆ TRACE_EVENT_API_GET_NUM_TRACES_RECORDED

#define TRACE_EVENT_API_GET_NUM_TRACES_RECORDED   UNIMPLEMENTED()

Definition at line 87 of file trace-event.h.

◆ TRACE_EVENT_API_LOAD_CATEGORY_GROUP_ENABLED

#define TRACE_EVENT_API_LOAD_CATEGORY_GROUP_ENABLED ( )
Value:
v8::base::Relaxed_Load(reinterpret_cast<const v8::base::Atomic8*>( \
INTERNAL_TRACE_EVENT_UID(category_group_enabled)))
Atomic8 Relaxed_Load(volatile const Atomic8 *ptr)
Definition atomicops.h:234
char Atomic8
Definition atomicops.h:57

Definition at line 139 of file trace-event.h.

◆ TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION

#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION
Value:
virtual void UpdateTraceEventDuration(const uint8_t *category_enabled_flag, const char *name, uint64_t handle)

Definition at line 126 of file trace-event.h.

◆ TRACE_EVENT_CALL_STATS_SCOPED

#define TRACE_EVENT_CALL_STATS_SCOPED ( isolate,
category_group,
name )
Value:
INTERNAL_TRACE_EVENT_CALL_STATS_SCOPED(isolate, category_group, name)
#define INTERNAL_TRACE_EVENT_CALL_STATS_SCOPED(isolate, category_group, name)

Definition at line 282 of file trace-event.h.

◆ TRACE_ID_WITH_SCOPE

#define TRACE_ID_WITH_SCOPE ( scope,
id )

◆ TRACE_STR_COPY

#define TRACE_STR_COPY ( str)

Enumeration Type Documentation

◆ CategoryGroupEnabledFlags

Enumerator
kEnabledForRecording_CategoryGroupEnabledFlags 
kEnabledForEventCallback_CategoryGroupEnabledFlags 
kEnabledForETWExport_CategoryGroupEnabledFlags 

Definition at line 35 of file trace-event.h.