|
v8
9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
|
Go to the documentation of this file.
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_;
122 virtual void Flush() = 0;
126 const std::string& tag);
140 void Reset(uint32_t new_seq);
145 uint32_t
seq()
const {
return seq_; }
146 size_t
size()
const {
return next_free_; }
151 size_t next_free_ = 0;
167 virtual bool Flush() = 0;
202 TraceConfig() : enable_systrace_(
false), enable_argument_filter_(
false) {}
205 return included_categories_;
220 bool enable_systrace_ : 1;
221 bool enable_argument_filter_ : 1;
229 #if defined(_MSC_VER)
230 #define V8_PLATFORM_NON_EXPORTED_BASE(code)
231 __pragma(warning(suppress : 4275
)) code
233 #define V8_PLATFORM_NON_EXPORTED_BASE(code) code
242 #if defined(V8_USE_PERFETTO)
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)
override;
276 char phase,
const uint8_t* category_enabled_flag,
const char* name,
277 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
278 const char** arg_names,
const uint8_t* arg_types,
279 const uint64_t* arg_values,
281 unsigned int flags, int64_t timestamp)
override;
283 const char* name, uint64_t handle)
override;
297 #if !defined(V8_USE_PERFETTO)
303 #if !defined(V8_USE_PERFETTO)
304 void UpdateCategoryGroupEnabledFlag(size_t category_index);
305 void UpdateCategoryGroupEnabledFlags();
308 std::unique_ptr<
base::Mutex> mutex_;
310 std::atomic_bool recording_{
false};
313 #if defined(V8_USE_PERFETTO)
328 #undef V8_PLATFORM_NON_EXPORTED_BASE
#define V8_PLATFORM_NON_EXPORTED_BASE(code)
#define V8_DEPRECATED(message)