5 #ifndef V8_LIBPLATFORM_V8_TRACING_H_
6 #define V8_LIBPLATFORM_V8_TRACING_H_
11 #include <unordered_set>
14 #include "libplatform/libplatform-export.h"
30 class TraceEventListener;
31 class JSONTraceEventListener;
49 char phase,
const uint8_t* category_enabled_flag,
const char* name,
50 const char* scope, uint64_t id, uint64_t bind_id,
int num_args,
51 const char** arg_names,
const uint8_t* arg_types,
52 const uint64_t* arg_values,
54 unsigned int flags, int64_t timestamp, int64_t cpu_timestamp);
57 char phase,
const uint8_t* category_enabled_flag,
const char* name,
58 const char* scope, uint64_t id, uint64_t bind_id,
int num_args,
59 const char** arg_names,
const uint8_t* arg_types,
60 const uint64_t* arg_values,
62 unsigned int flags,
int pid,
int tid, int64_t ts, int64_t tts,
63 uint64_t duration, uint64_t cpu_duration);
65 int pid()
const {
return pid_; }
66 int tid()
const {
return tid_; }
67 char phase()
const {
return phase_; }
69 return category_enabled_flag_;
71 const char*
name()
const {
return name_; }
72 const char*
scope()
const {
return scope_; }
73 uint64_t
id()
const {
return id_; }
74 uint64_t
bind_id()
const {
return bind_id_; }
80 return arg_convertables_;
82 unsigned int flags()
const {
return flags_; }
83 int64_t
ts() {
return ts_; }
84 int64_t
tts() {
return tts_; }
94 const uint8_t* category_enabled_flag_;
103 char* parameter_copy_storage_ =
nullptr;
108 uint64_t cpu_duration_;
124 const std::string& tag);
141 uint32_t
seq()
const {
return seq_; }
142 size_t
size()
const {
return next_free_; }
147 size_t next_free_ = 0;
198 TraceConfig() : enable_systrace_(
false), enable_argument_filter_(
false) {}
213 bool enable_systrace_ : 1;
214 bool enable_argument_filter_ : 1;
222 #if defined(_MSC_VER)
223 #define V8_PLATFORM_NON_EXPORTED_BASE(code)
224 __pragma(warning(suppress : 4275
)) code
226 #define V8_PLATFORM_NON_EXPORTED_BASE(code) code
250 #ifdef V8_USE_PERFETTO
262 char phase,
const uint8_t* category_enabled_flag,
const char* name,
263 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
264 const char** arg_names,
const uint8_t* arg_types,
265 const uint64_t* arg_values,
267 unsigned int flags)
override;
269 char phase,
const uint8_t* category_enabled_flag,
const char* name,
270 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
271 const char** arg_names,
const uint8_t* arg_types,
272 const uint64_t* arg_values,
274 unsigned int flags, int64_t timestamp)
override;
276 const char* name, uint64_t handle)
override;
292 void UpdateCategoryGroupEnabledFlag(size_t category_index);
293 void UpdateCategoryGroupEnabledFlags();
297 std::unique_ptr<
base::Mutex> mutex_;
299 std::atomic_bool recording_{
false};
300 #ifdef V8_USE_PERFETTO
312 #undef V8_PLATFORM_NON_EXPORTED_BASE