summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2018-09-11 15:40:28 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2018-09-13 18:05:18 -0700
commitff05f6490aa2f568b1f26193cf1033e6392af4b4 (patch)
tree1767eec09bc6cbcb954a47d07c5f68a2d30b4f60
parent5cccc5545b0edfa41062497d2bd06a90dff027cd (diff)
downloadandroid-node-v8-ff05f6490aa2f568b1f26193cf1033e6392af4b4.tar.gz
android-node-v8-ff05f6490aa2f568b1f26193cf1033e6392af4b4.tar.bz2
android-node-v8-ff05f6490aa2f568b1f26193cf1033e6392af4b4.zip
deps: cherry-pick 2363cdf from upstream V8
Original commit message: [tracing] do not add traces when disabled https://github.com/nodejs/node/issues/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: https://github.com/v8/v8/commit/2363cdfefeb643285cbe8593b7c17d80e5d06cd9 PR-URL: https://github.com/nodejs/node/pull/22812 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
-rw-r--r--common.gypi2
-rw-r--r--deps/v8/src/libplatform/tracing/tracing-controller.cc32
2 files changed, 19 insertions, 15 deletions
diff --git a/common.gypi b/common.gypi
index cba83cc8cf..25e28c94fa 100644
--- a/common.gypi
+++ b/common.gypi
@@ -29,7 +29,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
- 'v8_embedder_string': '-node.9',
+ 'v8_embedder_string': '-node.10',
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
diff --git a/deps/v8/src/libplatform/tracing/tracing-controller.cc b/deps/v8/src/libplatform/tracing/tracing-controller.cc
index b4aa7baf72..e0a6a1234c 100644
--- a/deps/v8/src/libplatform/tracing/tracing-controller.cc
+++ b/deps/v8/src/libplatform/tracing/tracing-controller.cc
@@ -63,13 +63,15 @@ uint64_t TracingController::AddTraceEvent(
const uint64_t* arg_values,
std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
unsigned int flags) {
- uint64_t handle;
- TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
- if (trace_object) {
- trace_object->Initialize(
- phase, category_enabled_flag, name, scope, id, bind_id, num_args,
- arg_names, arg_types, arg_values, arg_convertables, flags,
- CurrentTimestampMicroseconds(), CurrentCpuTimestampMicroseconds());
+ uint64_t handle = 0;
+ if (mode_ != DISABLED) {
+ TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
+ if (trace_object) {
+ trace_object->Initialize(
+ phase, category_enabled_flag, name, scope, id, bind_id, num_args,
+ arg_names, arg_types, arg_values, arg_convertables, flags,
+ CurrentTimestampMicroseconds(), CurrentCpuTimestampMicroseconds());
+ }
}
return handle;
}
@@ -81,13 +83,15 @@ uint64_t TracingController::AddTraceEventWithTimestamp(
const uint64_t* arg_values,
std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
unsigned int flags, int64_t timestamp) {
- uint64_t handle;
- TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
- if (trace_object) {
- trace_object->Initialize(phase, category_enabled_flag, name, scope, id,
- bind_id, num_args, arg_names, arg_types,
- arg_values, arg_convertables, flags, timestamp,
- CurrentCpuTimestampMicroseconds());
+ uint64_t handle = 0;
+ if (mode_ != DISABLED) {
+ TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle);
+ if (trace_object) {
+ trace_object->Initialize(phase, category_enabled_flag, name, scope, id,
+ bind_id, num_args, arg_names, arg_types,
+ arg_values, arg_convertables, flags, timestamp,
+ CurrentCpuTimestampMicroseconds());
+ }
}
return handle;
}