diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2018-08-03 16:22:31 -0700 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2018-09-04 14:24:20 +0200 |
commit | ec285c8c6697e2b415addd81fddafd81980f8b2c (patch) | |
tree | 50e06e572fdc0616b97ee9840f3e30cefb885ab3 /deps/v8/src/libplatform | |
parent | c0fb95d700574a369988f3379559f66dba57404c (diff) | |
download | node-new-ec285c8c6697e2b415addd81fddafd81980f8b2c.tar.gz |
deps: cherry-pick bf5ea81 from upstream V8
Original commit message:
[tracing] allow dynamic control of tracing
If the trace_buffer_ was null, we were returning a pointer to a static
flag back that permanently disabled that particular trace point.
This implied an assumption that tracing will be statically enabled at
process startup, and once it is disabled, it will never be enabled
again. On Node.js side we want to dynamically enable/disable tracing as per
programmer intent.
Change-Id: Ic7a7839b8450ab5c356d85e8e0826f42824907f4
Reviewed-on: https://chromium-review.googlesource.com/1161518
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#54903}
Refs: https://github.com/v8/v8/commit/bf5ea8138c0726613c9d722a3ccb552a8f477992
PR-URL: https://github.com/nodejs/node/pull/22114
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/v8/src/libplatform')
-rw-r--r-- | deps/v8/src/libplatform/tracing/tracing-controller.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/deps/v8/src/libplatform/tracing/tracing-controller.cc b/deps/v8/src/libplatform/tracing/tracing-controller.cc index 647306d627..b4aa7baf72 100644 --- a/deps/v8/src/libplatform/tracing/tracing-controller.cc +++ b/deps/v8/src/libplatform/tracing/tracing-controller.cc @@ -24,18 +24,17 @@ namespace tracing { // convert internally to determine the category name from the char enabled // pointer. const char* g_category_groups[MAX_CATEGORY_GROUPS] = { - "toplevel", "tracing already shutdown", + "toplevel", "tracing categories exhausted; must increase MAX_CATEGORY_GROUPS", "__metadata"}; // The enabled flag is char instead of bool so that the API can be used from C. unsigned char g_category_group_enabled[MAX_CATEGORY_GROUPS] = {0}; // Indexes here have to match the g_category_groups array indexes above. -const int g_category_already_shutdown = 1; -const int g_category_categories_exhausted = 2; +const int g_category_categories_exhausted = 1; // Metadata category not used in V8. -// const int g_category_metadata = 3; -const int g_num_builtin_categories = 4; +// const int g_category_metadata = 2; +const int g_num_builtin_categories = 3; // Skip default categories. v8::base::AtomicWord g_category_index = g_num_builtin_categories; @@ -103,10 +102,6 @@ void TracingController::UpdateTraceEventDuration( const uint8_t* TracingController::GetCategoryGroupEnabled( const char* category_group) { - if (!trace_buffer_) { - DCHECK(!g_category_group_enabled[g_category_already_shutdown]); - return &g_category_group_enabled[g_category_already_shutdown]; - } return GetCategoryGroupEnabledInternal(category_group); } |