5 #ifndef V8_LIBPLATFORM_V8_TRACING_H_
6 #define V8_LIBPLATFORM_V8_TRACING_H_
11 #include <unordered_set>
14 #include "libplatform/libplatform-export.h"
19 class TraceProcessorStorage;
33 class TraceEventListener;
50 char phase,
const uint8_t* category_enabled_flag,
const char* name,
51 const char* scope, uint64_t id, uint64_t bind_id,
int num_args,
52 const char** arg_names,
const uint8_t* arg_types,
53 const uint64_t* arg_values,
55 unsigned int flags, int64_t timestamp, int64_t cpu_timestamp);
58 char phase,
const uint8_t* category_enabled_flag,
const char* name,
59 const char* scope, uint64_t id, uint64_t bind_id,
int num_args,
60 const char** arg_names,
const uint8_t* arg_types,
61 const uint64_t* arg_values,
63 unsigned int flags,
int pid,
int tid, int64_t ts, int64_t tts,
64 uint64_t duration, uint64_t cpu_duration);
66 int pid()
const {
return pid_; }
67 int tid()
const {
return tid_; }
68 char phase()
const {
return phase_; }
70 return category_enabled_flag_;
72 const char*
name()
const {
return name_; }
73 const char*
scope()
const {
return scope_; }
74 uint64_t
id()
const {
return id_; }
75 uint64_t
bind_id()
const {
return bind_id_; }
81 return arg_convertables_;
83 unsigned int flags()
const {
return flags_; }
84 int64_t
ts() {
return ts_; }
85 int64_t
tts() {
return tts_; }
95 const uint8_t* category_enabled_flag_;
104 char* parameter_copy_storage_ =
nullptr;
109 uint64_t cpu_duration_;
125 const std::string& tag);
144 uint32_t
seq()
const {
return seq_; }
145 size_t
size()
const {
return next_free_; }
150 size_t next_free_ = 0;
201 TraceConfig() : enable_systrace_(
false), enable_argument_filter_(
false) {}
204 return included_categories_;
219 bool enable_systrace_ : 1;
220 bool enable_argument_filter_ : 1;
228 #if defined(_MSC_VER)
229 #define V8_PLATFORM_NON_EXPORTED_BASE(code)
230 __pragma(warning(suppress : 4275
)) code
232 #define V8_PLATFORM_NON_EXPORTED_BASE(code) code
241 #if defined(V8_USE_PERFETTO)
268 char phase,
const uint8_t* category_enabled_flag,
const char* name,
269 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
270 const char** arg_names,
const uint8_t* arg_types,
271 const uint64_t* arg_values,
273 unsigned int flags)
override;
275 char phase,
const uint8_t* category_enabled_flag,
const char* name,
276 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
277 const char** arg_names,
const uint8_t* arg_types,
278 const uint64_t* arg_values,
280 unsigned int flags, int64_t timestamp)
override;
282 const char* name, uint64_t handle)
override;
296 #if !defined(V8_USE_PERFETTO)
302 #if !defined(V8_USE_PERFETTO)
303 void UpdateCategoryGroupEnabledFlag(size_t category_index);
304 void UpdateCategoryGroupEnabledFlags();
307 std::unique_ptr<
base::Mutex> mutex_;
309 std::atomic_bool recording_{
false};
312 #if defined(V8_USE_PERFETTO)
327 #undef V8_PLATFORM_NON_EXPORTED_BASE