Commit 15f8871c authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

Revert "[tracing] allow dynamic control of tracing"

This reverts commit bf5ea813.

Reason for revert: Breaks Sanitizers
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20ASAN/26688

Original change's description:
> [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}

TBR=yangguo@chromium.org,ofrobots@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I9459992e8c2ee403b9ddc8f6b9582d204139f6e8
Reviewed-on: https://chromium-review.googlesource.com/1162122Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54911}
parent 827e7bc4
...@@ -24,17 +24,18 @@ namespace tracing { ...@@ -24,17 +24,18 @@ namespace tracing {
// convert internally to determine the category name from the char enabled // convert internally to determine the category name from the char enabled
// pointer. // pointer.
const char* g_category_groups[MAX_CATEGORY_GROUPS] = { const char* g_category_groups[MAX_CATEGORY_GROUPS] = {
"toplevel", "toplevel", "tracing already shutdown",
"tracing categories exhausted; must increase MAX_CATEGORY_GROUPS", "tracing categories exhausted; must increase MAX_CATEGORY_GROUPS",
"__metadata"}; "__metadata"};
// The enabled flag is char instead of bool so that the API can be used from C. // 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}; unsigned char g_category_group_enabled[MAX_CATEGORY_GROUPS] = {0};
// Indexes here have to match the g_category_groups array indexes above. // Indexes here have to match the g_category_groups array indexes above.
const int g_category_categories_exhausted = 1; const int g_category_already_shutdown = 1;
const int g_category_categories_exhausted = 2;
// Metadata category not used in V8. // Metadata category not used in V8.
// const int g_category_metadata = 2; // const int g_category_metadata = 3;
const int g_num_builtin_categories = 3; const int g_num_builtin_categories = 4;
// Skip default categories. // Skip default categories.
v8::base::AtomicWord g_category_index = g_num_builtin_categories; v8::base::AtomicWord g_category_index = g_num_builtin_categories;
...@@ -102,6 +103,10 @@ void TracingController::UpdateTraceEventDuration( ...@@ -102,6 +103,10 @@ void TracingController::UpdateTraceEventDuration(
const uint8_t* TracingController::GetCategoryGroupEnabled( const uint8_t* TracingController::GetCategoryGroupEnabled(
const char* category_group) { 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); return GetCategoryGroupEnabledInternal(category_group);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment