Commit 25670014 authored by Mike Wittman's avatar Mike Wittman Committed by Commit Bot

[Sampling profiler] Enable new profile builder at 100%

The additional representational overhead imposed by the new profiler is
approximately 1.1k bytes/uncompressed encoded profile, which is
sufficiently small given the additional capabilities it supports.

Bug: 851163
Change-Id: Iecddca885dac528fd305ecbb9692a824ec4280db
Reviewed-on: https://chromium-review.googlesource.com/c/1351387
Commit-Queue: Mike Wittman <wittman@chromium.org>
Reviewed-by: default avatarXi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611160}
parent 7c792690
......@@ -24,7 +24,6 @@
using CallStackProfileBuilder = metrics::CallStackProfileBuilder;
using CallStackProfileParams = metrics::CallStackProfileParams;
using LegacyCallStackProfileBuilder = metrics::LegacyCallStackProfileBuilder;
using StackSamplingProfiler = base::StackSamplingProfiler;
namespace {
......@@ -70,13 +69,7 @@ std::unique_ptr<base::StackSamplingProfiler::ProfileBuilder>
CreateProfileBuilder(
const CallStackProfileParams& params,
base::OnceClosure completed_callback = base::OnceClosure()) {
// Enable the new profile builder half the time.
if (base::RandInt(0, 99) < 50) {
return std::make_unique<CallStackProfileBuilder>(
params, std::move(completed_callback));
}
return std::make_unique<LegacyCallStackProfileBuilder>(
return std::make_unique<CallStackProfileBuilder>(
params, std::move(completed_callback));
}
......@@ -167,7 +160,6 @@ void ThreadProfiler::StartOnChildThread(CallStackProfileParams::Thread thread) {
void ThreadProfiler::SetBrowserProcessReceiverCallback(
const base::RepeatingCallback<void(base::TimeTicks,
metrics::SampledProfile)>& callback) {
LegacyCallStackProfileBuilder::SetBrowserProcessReceiverCallback(callback);
CallStackProfileBuilder::SetBrowserProcessReceiverCallback(callback);
}
......@@ -182,7 +174,7 @@ void ThreadProfiler::SetServiceManagerConnectorForChildProcess(
metrics::mojom::CallStackProfileCollectorPtr browser_interface;
connector->BindInterface(content::mojom::kBrowserServiceName,
&browser_interface);
LegacyCallStackProfileBuilder::SetParentProfileCollectorForChildProcess(
CallStackProfileBuilder::SetParentProfileCollectorForChildProcess(
std::move(browser_interface));
}
......
......@@ -15,7 +15,7 @@
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "components/metrics/call_stack_profile_params.h"
#include "components/metrics/legacy_call_stack_profile_builder.h"
#include "third_party/metrics_proto/sampled_profile.pb.h"
namespace service_manager {
class Connector;
......
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