Skip to content

Commit dca0300

Browse files
committed
deps: cherry-pick 2363cdf from upstream V8
Original commit message: [tracing] do not add traces when disabled #21038 Change-Id: Ic4c9f403b5e54a97d3170b2311dd5aab8c8357c8 Reviewed-on: https://chromium-review.googlesource.com/1217726 Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#55809} Refs: v8/v8@2363cdf PR-URL: #22754 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 1da9d60 commit dca0300

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Reset this number to 0 on major V8 upgrades.
3131
# Increment by one for each non-official patch applied to deps/v8.
32-
'v8_embedder_string': '-node.1',
32+
'v8_embedder_string': '-node.2',
3333

3434
# Enable disassembler for `--print-code` v8 options
3535
'v8_enable_disassembler': 1,

deps/v8/src/libplatform/tracing/tracing-controller.cc

+18-14
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ uint64_t TracingController::AddTraceEvent(
7777
const uint64_t* arg_values,
7878
std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
7979
unsigned int flags) {
80-
uint64_t handle;
81-
TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
82-
if (trace_object) {
83-
trace_object->Initialize(
84-
phase, category_enabled_flag, name, scope, id, bind_id, num_args,
85-
arg_names, arg_types, arg_values, arg_convertables, flags,
86-
CurrentTimestampMicroseconds(), CurrentCpuTimestampMicroseconds());
80+
uint64_t handle = 0;
81+
if (mode_ != DISABLED) {
82+
TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
83+
if (trace_object) {
84+
trace_object->Initialize(
85+
phase, category_enabled_flag, name, scope, id, bind_id, num_args,
86+
arg_names, arg_types, arg_values, arg_convertables, flags,
87+
CurrentTimestampMicroseconds(), CurrentCpuTimestampMicroseconds());
88+
}
8789
}
8890
return handle;
8991
}
@@ -95,13 +97,15 @@ uint64_t TracingController::AddTraceEventWithTimestamp(
9597
const uint64_t* arg_values,
9698
std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
9799
unsigned int flags, int64_t timestamp) {
98-
uint64_t handle;
99-
TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
100-
if (trace_object) {
101-
trace_object->Initialize(phase, category_enabled_flag, name, scope, id,
102-
bind_id, num_args, arg_names, arg_types,
103-
arg_values, arg_convertables, flags, timestamp,
104-
CurrentCpuTimestampMicroseconds());
100+
uint64_t handle = 0;
101+
if (mode_ != DISABLED) {
102+
TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
103+
if (trace_object) {
104+
trace_object->Initialize(phase, category_enabled_flag, name, scope, id,
105+
bind_id, num_args, arg_names, arg_types,
106+
arg_values, arg_convertables, flags, timestamp,
107+
CurrentCpuTimestampMicroseconds());
108+
}
105109
}
106110
return handle;
107111
}

0 commit comments

Comments
 (0)