Commit dbf9ff61 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cpu-profiler] Remove hi-res options via tracing category

The devtools frontend used this to set a lower interval (100us). Now the
frontend will stop setting this category and we will always profile
with 100us (which was already the default).

Bug: chromium:1082220

Change-Id: Iaa671d9750ad4c13b95c2c1ba1e433a1077c858a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2198989Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67805}
parent 78774f07
......@@ -50,10 +50,7 @@ void TracingCpuProfilerImpl::OnTraceDisabled() {
void TracingCpuProfilerImpl::StartProfiling() {
base::MutexGuard lock(&mutex_);
if (!profiling_enabled_ || profiler_) return;
bool enabled;
TRACE_EVENT_CATEGORY_GROUP_ENABLED(
TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler.hires"), &enabled);
int sampling_interval_us = enabled ? 100 : 1000;
int sampling_interval_us = 100;
profiler_.reset(new CpuProfiler(isolate_, kDebugNaming));
profiler_->set_sampling_interval(
base::TimeDelta::FromMicroseconds(sampling_interval_us));
......
......@@ -39,7 +39,6 @@ PERFETTO_DEFINE_CATEGORIES(
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.compile")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler.hires")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.gc")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.gc_stats")),
perfetto::Category(TRACE_DISABLED_BY_DEFAULT("v8.ic_stats")),
......
......@@ -30,7 +30,6 @@ TEST(TestTraceConfig) {
CHECK_EQ(trace_config->IsArgumentFilterEnabled(), false);
CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8"), true);
CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8.cpu_profile"), false);
CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8.cpu_profile.hires"), false);
CHECK_EQ(trace_config->IsCategoryGroupEnabled(
TRACE_DISABLED_BY_DEFAULT("v8.runtime")),
true);
......@@ -38,9 +37,7 @@ TEST(TestTraceConfig) {
CHECK_EQ(
trace_config->IsCategoryGroupEnabled("v8,disabled-by-default-v8.runtime"),
true);
CHECK_EQ(trace_config->IsCategoryGroupEnabled(
"v8_cpu_profile,v8.cpu_profile.hires"),
false);
CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8_cpu_profile"), false);
delete trace_config;
}
......
......@@ -2735,8 +2735,6 @@ TEST(TracingCpuProfiler) {
TraceConfig* trace_config = new TraceConfig();
trace_config->AddIncludedCategory(
TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler"));
trace_config->AddIncludedCategory(
TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler.hires"));
std::string test_code = R"(
function foo() {
......
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