Commit 9c781943 authored by lpy's avatar lpy Committed by Commit bot

[Tracing] Remove unused excluded categories list.

We only need included categories list, excluded categories list will only work
if we use regular expression in categories list, which is not supported in V8.

TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2462143002
Cr-Commit-Position: refs/heads/master@{#40681}
parent da90034e
......@@ -195,7 +195,6 @@ class V8_PLATFORM_EXPORT TraceConfig {
void EnableArgumentFilter() { enable_argument_filter_ = true; }
void AddIncludedCategory(const char* included_category);
void AddExcludedCategory(const char* excluded_category);
bool IsCategoryGroupEnabled(const char* category_group) const;
......@@ -204,7 +203,6 @@ class V8_PLATFORM_EXPORT TraceConfig {
bool enable_systrace_ : 1;
bool enable_argument_filter_ : 1;
StringList included_categories_;
StringList excluded_categories_;
// Disallow copy and assign
TraceConfig(const TraceConfig&) = delete;
......
......@@ -204,7 +204,6 @@ const char kRecordModeParam[] = "record_mode";
const char kEnableSystraceParam[] = "enable_systrace";
const char kEnableArgumentFilterParam[] = "enable_argument_filter";
const char kIncludedCategoriesParam[] = "included_categories";
const char kExcludedCategoriesParam[] = "excluded_categories";
class TraceConfigParser {
public:
......@@ -232,10 +231,8 @@ class TraceConfigParser {
kEnableArgumentFilterParam)) {
trace_config->EnableArgumentFilter();
}
UpdateCategoriesList(isolate, context, trace_config_object,
kIncludedCategoriesParam, trace_config);
UpdateCategoriesList(isolate, context, trace_config_object,
kExcludedCategoriesParam, trace_config);
UpdateIncludedCategoriesList(isolate, context, trace_config_object,
trace_config);
}
private:
......@@ -249,10 +246,11 @@ class TraceConfigParser {
return false;
}
static int UpdateCategoriesList(
static int UpdateIncludedCategoriesList(
v8::Isolate* isolate, Local<Context> context, Local<v8::Object> object,
const char* property, platform::tracing::TraceConfig* trace_config) {
Local<Value> value = GetValue(isolate, context, object, property);
platform::tracing::TraceConfig* trace_config) {
Local<Value> value =
GetValue(isolate, context, object, kIncludedCategoriesParam);
if (value->IsArray()) {
Local<Array> v8_array = Local<Array>::Cast(value);
for (int i = 0, length = v8_array->Length(); i < length; ++i) {
......@@ -261,11 +259,7 @@ class TraceConfigParser {
->ToString(context)
.ToLocalChecked();
String::Utf8Value str(v->ToString(context).ToLocalChecked());
if (kIncludedCategoriesParam == property) {
trace_config->AddIncludedCategory(*str);
} else {
trace_config->AddExcludedCategory(*str);
}
trace_config->AddIncludedCategory(*str);
}
return v8_array->Length();
}
......
......@@ -32,11 +32,6 @@ void TraceConfig::AddIncludedCategory(const char* included_category) {
included_categories_.push_back(included_category);
}
void TraceConfig::AddExcludedCategory(const char* excluded_category) {
DCHECK(excluded_category != NULL && strlen(excluded_category) > 0);
excluded_categories_.push_back(excluded_category);
}
} // namespace tracing
} // namespace platform
} // namespace v8
......@@ -16,7 +16,6 @@ TEST(TestTraceConfig) {
TraceConfig* trace_config = new TraceConfig();
trace_config->AddIncludedCategory("v8");
trace_config->AddIncludedCategory(TRACE_DISABLED_BY_DEFAULT("v8.runtime"));
trace_config->AddExcludedCategory("v8.cpu_profile");
CHECK_EQ(trace_config->IsSystraceEnabled(), false);
CHECK_EQ(trace_config->IsArgumentFilterEnabled(), false);
......
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