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;
51 char phase,
const uint8_t* category_enabled_flag,
const char* name,
52 const char* scope, uint64_t id, uint64_t bind_id,
int num_args,
53 const char** arg_names,
const uint8_t* arg_types,
54 const uint64_t* arg_values,
56 unsigned int flags, int64_t timestamp, int64_t cpu_timestamp);
59 char phase,
const uint8_t* category_enabled_flag,
const char* name,
60 const char* scope, uint64_t id, uint64_t bind_id,
int num_args,
61 const char** arg_names,
const uint8_t* arg_types,
62 const uint64_t* arg_values,
64 unsigned int flags,
int pid,
int tid, int64_t ts, int64_t tts,
65 uint64_t duration, uint64_t cpu_duration);
67 int pid()
const {
return pid_; }
68 int tid()
const {
return tid_; }
69 char phase()
const {
return phase_; }
71 return category_enabled_flag_;
73 const char*
name()
const {
return name_; }
74 const char*
scope()
const {
return scope_; }
75 uint64_t
id()
const {
return id_; }
76 uint64_t
bind_id()
const {
return bind_id_; }
82 return arg_convertables_;
84 unsigned int flags()
const {
return flags_; }
85 int64_t
ts() {
return ts_; }
86 int64_t
tts() {
return tts_; }
96 const uint8_t* category_enabled_flag_;
105 char* parameter_copy_storage_ =
nullptr;
110 uint64_t cpu_duration_;
126 const std::string& tag);
143 uint32_t
seq()
const {
return seq_; }
144 size_t
size()
const {
return next_free_; }
149 size_t next_free_ = 0;
200 TraceConfig() : enable_systrace_(
false), enable_argument_filter_(
false) {}
203 return included_categories_;
218 bool enable_systrace_ : 1;
219 bool enable_argument_filter_ : 1;
227 #if defined(_MSC_VER)
228 #define V8_PLATFORM_NON_EXPORTED_BASE(code)
229 __pragma(warning(suppress : 4275
)) code
231 #define V8_PLATFORM_NON_EXPORTED_BASE(code) code
240 #if defined(V8_USE_PERFETTO)
267 char phase,
const uint8_t* category_enabled_flag,
const char* name,
268 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
269 const char** arg_names,
const uint8_t* arg_types,
270 const uint64_t* arg_values,
272 unsigned int flags)
override;
274 char phase,
const uint8_t* category_enabled_flag,
const char* name,
275 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
276 const char** arg_names,
const uint8_t* arg_types,
277 const uint64_t* arg_values,
279 unsigned int flags, int64_t timestamp)
override;
281 const char* name, uint64_t handle)
override;
295 #if !defined(V8_USE_PERFETTO)
301 #if !defined(V8_USE_PERFETTO)
302 void UpdateCategoryGroupEnabledFlag(size_t category_index);
303 void UpdateCategoryGroupEnabledFlags();
306 std::unique_ptr<
base::Mutex> mutex_;
308 std::atomic_bool recording_{
false};
311 #if defined(V8_USE_PERFETTO)
326 #undef V8_PLATFORM_NON_EXPORTED_BASE