Node.js  v8.x
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine
trace_event.h File Reference
#include <stddef.h>
#include "node_platform.h"
#include "v8-platform.h"
#include "trace_event_common.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.

Data Structures

class  TraceEventHelper
 
class  TraceID
 
class  TraceID::WithScope
 
class  TraceID::DontMangle
 
class  TraceID::ForceMangle
 
union  TraceValueUnion
 
class  TraceStringWithCopy
 
class  ScopedTracer
 

Namespaces

 node
 
 node::tracing
 

Macros

#define TRACE_STR_COPY(str)   node::tracing::TraceStringWithCopy(str)
 
#define TRACE_ID_MANGLE(id)   node::tracing::TraceID::ForceMangle(id)
 
#define TRACE_ID_DONT_MANGLE(id)   node::tracing::TraceID::DontMangle(id)
 
#define TRACE_ID_WITH_SCOPE(scope, id)   trace_event_internal::TraceID::WithScope(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   node::tracing::AddTraceEventImpl
 
#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION
 
#define TRACE_EVENT_API_ATOMIC_WORD   intptr_t
 
#define TRACE_EVENT_API_ATOMIC_LOAD(var)   (var)
 
#define TRACE_EVENT_API_ATOMIC_STORE(var, value)   (var) = (value)
 
#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_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, ...)   UNIMPLEMENTED()
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( phase, category_group, name, id, timestamp, flags, ...)   UNIMPLEMENTED()
 
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( phase, category_group, name, id, thread_id, timestamp, flags, ...)   UNIMPLEMENTED()
 
#define INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context)
 
#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, union_member, value_type_id)
 
#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, value_type_id)
 

Enumerations

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

Functions

 INTERNAL_DECLARE_SET_TRACE_VALUE (const void *, as_pointer, TRACE_VALUE_TYPE_POINTER) INTERNAL_DECLARE_SET_TRACE_VALUE(const char *
 
TRACE_VALUE_TYPE_STRING INTERNAL_DECLARE_SET_TRACE_VALUE (const TraceStringWithCopy &, as_string, TRACE_VALUE_TYPE_COPY_STRING) static inline void SetTraceValue(v8
 

Variables

const int kZeroNumArgs = 0
 
decltype(nullptr) const kGlobalScope = nullptr
 
const uint64_t kNoId = 0
 
intptr_t kRuntimeCallStatsTracingEnabled
 
 as_string
 

Macro Definition Documentation

◆ INTERNAL_DECLARE_SET_TRACE_VALUE

#define INTERNAL_DECLARE_SET_TRACE_VALUE (   actual_type,
  union_member,
  value_type_id 
)
Value:
static inline void SetTraceValue(actual_type arg, unsigned char* type, \
uint64_t* value) { \
TraceValueUnion type_value; \
type_value.union_member = arg; \
*type = value_type_id; \
*value = type_value.as_uint; \
}

Definition at line 420 of file trace_event.h.

◆ INTERNAL_DECLARE_SET_TRACE_VALUE_INT

#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT (   actual_type,
  value_type_id 
)
Value:
static inline void SetTraceValue(actual_type arg, unsigned char* type, \
uint64_t* value) { \
*type = value_type_id; \
*value = static_cast<uint64_t>(arg); \
}

Definition at line 430 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); \
node::tracing::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
node::tracing::kNoId, flags, ##__VA_ARGS__); \
} \
} while (0)
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
Definition: trace_event.h:50
const uint64_t kNoId
Definition: trace_event.h:256
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118
decltype(nullptr) const kGlobalScope
Definition: trace_event.h:255

Definition at line 149 of file trace_event.h.

◆ INTERNAL_TRACE_EVENT_ADD_SCOPED

#define INTERNAL_TRACE_EVENT_ADD_SCOPED (   category_group,
  name,
  ... 
)
Value:
node::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \
uint64_t h = node::tracing::AddTraceEvent( \
INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
INTERNAL_TRACE_EVENT_UID(tracer) \
.Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
h); \
}
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
Definition: trace_event.h:50
#define TRACE_EVENT_FLAG_NONE
const uint64_t kNoId
Definition: trace_event.h:256
#define TRACE_EVENT_PHASE_COMPLETE
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)
Definition: trace_event.h:140
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118
decltype(nullptr) const kGlobalScope
Definition: trace_event.h:255

Definition at line 163 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:
node::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \
unsigned int trace_event_flags = flow_flags; \
node::tracing::TraceID trace_event_bind_id(bind_id, \
&trace_event_flags); \
uint64_t h = node::tracing::AddTraceEvent( \
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); \
}
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
Definition: trace_event.h:50
const uint64_t kNoId
Definition: trace_event.h:256
#define TRACE_EVENT_PHASE_COMPLETE
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)
Definition: trace_event.h:140
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118
decltype(nullptr) const kGlobalScope
Definition: trace_event.h:255

Definition at line 177 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; \
node::tracing::TraceID trace_event_trace_id(id, \
&trace_event_flags); \
node::tracing::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \
node::tracing::kNoId, trace_event_flags, ##__VA_ARGS__); \
} \
} while (0)
#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()
Definition: trace_event.h:50
const uint64_t kNoId
Definition: trace_event.h:256
#define TRACE_EVENT_FLAG_HAS_ID
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118

Definition at line 197 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,
  ... 
)    UNIMPLEMENTED()

Definition at line 218 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,
  ... 
)    UNIMPLEMENTED()

Definition at line 224 of file trace_event.h.

◆ INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP

#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP (   phase,
  category_group,
  name,
  timestamp,
  flags,
  ... 
)    UNIMPLEMENTED()

Definition at line 213 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:
*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \
kEnabledForEventCallback_CategoryGroupEnabledFlags)
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118

Definition at line 50 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: trace_event.h:107
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118

Definition at line 140 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: trace_event.h:108

Definition at line 128 of file trace_event.h.

◆ INTERNAL_TRACE_EVENT_SCOPED_CONTEXT

#define INTERNAL_TRACE_EVENT_SCOPED_CONTEXT (   category_group,
  name,
  context 
)
Value:
struct INTERNAL_TRACE_EVENT_UID(ScopedContext) { \
public: \
INTERNAL_TRACE_EVENT_UID(ScopedContext)(uint64_t cid) : cid_(cid) { \
TRACE_EVENT_ENTER_CONTEXT(category_group, name, cid_); \
} \
~INTERNAL_TRACE_EVENT_UID(ScopedContext)() { \
TRACE_EVENT_LEAVE_CONTEXT(category_group, name, cid_); \
} \
\
private: \
/* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \
INTERNAL_TRACE_EVENT_UID(ScopedContext) \
(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {} \
void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {} \
uint64_t cid_; \
}; \
INTERNAL_TRACE_EVENT_UID(ScopedContext) \
INTERNAL_TRACE_EVENT_UID(scoped_context)(context);
#define INTERNAL_TRACE_EVENT_UID(name_prefix)
Definition: trace_event.h:118

Definition at line 229 of file trace_event.h.

◆ INTERNAL_TRACE_EVENT_UID

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

Definition at line 118 of file trace_event.h.

◆ INTERNAL_TRACE_EVENT_UID2

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

Definition at line 117 of file trace_event.h.

◆ INTERNAL_TRACE_EVENT_UID3

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

Definition at line 116 of file trace_event.h.

◆ INTERNAL_TRACE_MEMORY

#define INTERNAL_TRACE_MEMORY (   category,
  name 
)

Definition at line 58 of file trace_event.h.

◆ TRACE_EVENT_API_ADD_TRACE_EVENT

#define TRACE_EVENT_API_ADD_TRACE_EVENT   node::tracing::AddTraceEventImpl

Definition at line 95 of file trace_event.h.

Referenced by node::tracing::INTERNAL_DECLARE_SET_TRACE_VALUE().

◆ TRACE_EVENT_API_ATOMIC_LOAD

#define TRACE_EVENT_API_ATOMIC_LOAD (   var)    (var)

Definition at line 108 of file trace_event.h.

◆ TRACE_EVENT_API_ATOMIC_STORE

#define TRACE_EVENT_API_ATOMIC_STORE (   var,
  value 
)    (var) = (value)

Definition at line 109 of file trace_event.h.

◆ TRACE_EVENT_API_ATOMIC_WORD

#define TRACE_EVENT_API_ATOMIC_WORD   intptr_t

Definition at line 107 of file trace_event.h.

◆ TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED

#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED
Value:
->GetCategoryGroupEnabled
static v8::TracingController * GetTracingController()
Definition: trace_event.cc:12

Definition at line 73 of file trace_event.h.

◆ TRACE_EVENT_API_GET_NUM_TRACES_RECORDED

#define TRACE_EVENT_API_GET_NUM_TRACES_RECORDED   UNIMPLEMENTED()

Definition at line 80 of file trace_event.h.

◆ TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION

#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION
Value:
->UpdateTraceEventDuration
static v8::TracingController * GetTracingController()
Definition: trace_event.cc:12

Definition at line 102 of file trace_event.h.

◆ TRACE_ID_DONT_MANGLE

#define TRACE_ID_DONT_MANGLE (   id)    node::tracing::TraceID::DontMangle(id)

Definition at line 43 of file trace_event.h.

◆ TRACE_ID_MANGLE

#define TRACE_ID_MANGLE (   id)    node::tracing::TraceID::ForceMangle(id)

Definition at line 39 of file trace_event.h.

◆ TRACE_ID_WITH_SCOPE

#define TRACE_ID_WITH_SCOPE (   scope,
  id 
)    trace_event_internal::TraceID::WithScope(scope, id)

Definition at line 47 of file trace_event.h.

◆ TRACE_STR_COPY

#define TRACE_STR_COPY (   str)    node::tracing::TraceStringWithCopy(str)

Definition at line 35 of file trace_event.h.

Enumeration Type Documentation

◆ CategoryGroupEnabledFlags

Enumerator
kEnabledForRecording_CategoryGroupEnabledFlags 
kEnabledForEventCallback_CategoryGroupEnabledFlags 
kEnabledForETWExport_CategoryGroupEnabledFlags 

Definition at line 24 of file trace_event.h.