@@ -285,22 +285,8 @@ index 8f053efe93324b9acbb4e85f7b974b4f7712e200..e331ed5567caa39ade90ce28cea69f1d
285
285
void NodeTraceWriter::FlushPrivate() {
286
286
std::string str;
287
287
int highest_request_id;
288
- diff --git a/src/tracing/node_trace_writer.h b/src/tracing/node_trace_writer.h
289
- index cd965d77b7859ff2edcf781a934594b5a9b6d251..fe1714ba77fddef693d37eeb8c7a196ddfd15c26 100644
290
- --- a/src/tracing/node_trace_writer.h
291
- +++ b/src/tracing/node_trace_writer.h
292
- @@ -20,7 +20,9 @@ class NodeTraceWriter : public AsyncTraceWriter {
293
- ~NodeTraceWriter() override;
294
-
295
- void InitializeOnThread(uv_loop_t* loop) override;
296
- + #ifndef V8_USE_PERFETTO
297
- void AppendTraceEvent(TraceObject* trace_event) override;
298
- + #endif
299
- void Flush(bool blocking) override;
300
-
301
- static const int kTracesPerFile = 1 << 19;
302
288
diff --git a/src/tracing/trace_event.h b/src/tracing/trace_event.h
303
- index be0f55a409a71bf9c1763c36fdc252857228742e..827b5330b2f8c545338a46c548f8abf4aab7f50c 100644
289
+ index a662a081dc3bf356bf93e4063fcb043e4d8df07b..c89cdfe2b2681fbf9946200a03d7d1f7bad21226 100644
304
290
--- a/src/tracing/trace_event.h
305
291
+++ b/src/tracing/trace_event.h
306
292
@@ -69,8 +69,16 @@ enum CategoryGroupEnabledFlags {
@@ -336,36 +322,31 @@ index be0f55a409a71bf9c1763c36fdc252857228742e..827b5330b2f8c545338a46c548f8abf4
336
322
337
323
// Adds a metadata event to the trace log. The |AppendValueAsTraceFormat| method
338
324
// on the convertable value will be called at flush time.
339
- @@ -319,10 +332,13 @@ class TraceEventHelper {
325
+ @@ -319,12 +332,15 @@ class TraceEventHelper {
340
326
static void SetAgent(Agent* agent);
341
327
342
328
static inline const uint8_t* GetCategoryGroupEnabled(const char* group) {
343
329
+ #ifndef V8_USE_PERFETTO
344
330
v8::TracingController* controller = GetTracingController();
345
331
static const uint8_t disabled = 0;
346
- if (UNLIKELY(controller == nullptr)) return &disabled;
332
+ if (controller == nullptr) [[unlikely]] {
333
+ return &disabled;
334
+ }
347
335
return controller->GetCategoryGroupEnabled(group);
348
336
+ #endif
349
337
+ return 0;
350
338
}
351
339
};
352
340
353
- @@ -460 ,6 +476 ,7 @@ static inline uint64_t AddTraceEventImpl(
341
+ @@ -462 ,6 +478 ,7 @@ static inline uint64_t AddTraceEventImpl(
354
342
const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
355
343
const char** arg_names, const uint8_t* arg_types,
356
344
const uint64_t* arg_values, unsigned int flags) {
357
345
+ #ifndef V8_USE_PERFETTO
358
346
std::unique_ptr<v8::ConvertableToTraceFormat> arg_convertibles[2];
359
347
if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) {
360
348
arg_convertibles[0].reset(reinterpret_cast<v8::ConvertableToTraceFormat*>(
361
- @@ -469,13 +486,14 @@ static inline uint64_t AddTraceEventImpl(
362
- arg_convertibles[1].reset(reinterpret_cast<v8::ConvertableToTraceFormat*>(
363
- static_cast<intptr_t>(arg_values[1])));
364
- }
365
- - // DCHECK(num_args, 2);
366
- v8::TracingController* controller =
367
- node::tracing::TraceEventHelper::GetTracingController();
368
- if (controller == nullptr) return 0;
349
+ @@ -478,6 +495,8 @@ static inline uint64_t AddTraceEventImpl(
369
350
return controller->AddTraceEvent(phase, category_group_enabled, name, scope, id,
370
351
bind_id, num_args, arg_names, arg_types,
371
352
arg_values, arg_convertibles, flags);
@@ -374,25 +355,18 @@ index be0f55a409a71bf9c1763c36fdc252857228742e..827b5330b2f8c545338a46c548f8abf4
374
355
}
375
356
376
357
static V8_INLINE uint64_t AddTraceEventWithTimestampImpl(
377
- @@ -483 ,6 +501 ,7 @@ static V8_INLINE uint64_t AddTraceEventWithTimestampImpl(
358
+ @@ -485 ,6 +504 ,7 @@ static V8_INLINE uint64_t AddTraceEventWithTimestampImpl(
378
359
const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
379
360
const char** arg_names, const uint8_t* arg_types,
380
361
const uint64_t* arg_values, unsigned int flags, int64_t timestamp) {
381
362
+ #ifndef V8_USE_PERFETTO
382
- std::unique_ptr<v8::ConvertableToTraceFormat> arg_convertables [2];
363
+ std::unique_ptr<v8::ConvertableToTraceFormat> arg_convertibles [2];
383
364
if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) {
384
- arg_convertables[0].reset(reinterpret_cast<v8::ConvertableToTraceFormat*>(
385
- @@ -492,19 +511,21 @@ static V8_INLINE uint64_t AddTraceEventWithTimestampImpl(
386
- arg_convertables[1].reset(reinterpret_cast<v8::ConvertableToTraceFormat*>(
387
- static_cast<intptr_t>(arg_values[1])));
388
- }
389
- - // DCHECK_LE(num_args, 2);
390
- v8::TracingController* controller =
391
- node::tracing::TraceEventHelper::GetTracingController();
392
- if (controller == nullptr) return 0;
365
+ arg_convertibles[0].reset(reinterpret_cast<v8::ConvertableToTraceFormat*>(
366
+ @@ -501,12 +521,15 @@ static V8_INLINE uint64_t AddTraceEventWithTimestampImpl(
393
367
return controller->AddTraceEventWithTimestamp(
394
368
phase, category_group_enabled, name, scope, id, bind_id, num_args,
395
- arg_names, arg_types, arg_values, arg_convertables , flags, timestamp);
369
+ arg_names, arg_types, arg_values, arg_convertibles , flags, timestamp);
396
370
+ #endif
397
371
+ return 0;
398
372
}
@@ -405,11 +379,12 @@ index be0f55a409a71bf9c1763c36fdc252857228742e..827b5330b2f8c545338a46c548f8abf4
405
379
std::unique_ptr<v8::ConvertableToTraceFormat> arg_convertibles[2];
406
380
if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) {
407
381
arg_convertibles[0].reset(reinterpret_cast<v8::ConvertableToTraceFormat*>(
408
- @@ -520 ,6 +541 ,7 @@ static V8_INLINE void AddMetadataEventImpl(
382
+ @@ -522 ,6 +545 ,7 @@ static V8_INLINE void AddMetadataEventImpl(
409
383
return agent->GetTracingController()->AddMetadataEvent(
410
384
category_group_enabled, name, num_args, arg_names, arg_types, arg_values,
411
385
arg_convertibles, flags);
412
386
+ #endif
413
387
}
414
388
415
389
// Define SetTraceValue for each allowed type. It stores the type and
390
+
0 commit comments