Commit 719b61da authored by Oystein Eftevaag's avatar Oystein Eftevaag Committed by Commit Bot

Perfetto: Move in-process mode behind a feature flag while investigating crash

R=ssid@chromium.org
BUG=961609

Change-Id: Ic25d4eb36f90506c8d21abf3df35fb3f11474746
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1616447
Commit-Queue: oysteine <oysteine@chromium.org>
Reviewed-by: default avatarssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660715}
parent 89ef77f9
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "services/tracing/perfetto/perfetto_service.h" #include "services/tracing/perfetto/perfetto_service.h"
#include "services/tracing/public/cpp/perfetto/producer_client.h" #include "services/tracing/public/cpp/perfetto/producer_client.h"
#include "services/tracing/public/cpp/perfetto/shared_memory.h" #include "services/tracing/public/cpp/perfetto/shared_memory.h"
#include "services/tracing/public/cpp/tracing_features.h"
#include "third_party/perfetto/include/perfetto/tracing/core/commit_data_request.h" #include "third_party/perfetto/include/perfetto/tracing/core/commit_data_request.h"
#include "third_party/perfetto/include/perfetto/tracing/core/data_source_descriptor.h" #include "third_party/perfetto/include/perfetto/tracing/core/data_source_descriptor.h"
#include "third_party/perfetto/include/perfetto/tracing/core/trace_config.h" #include "third_party/perfetto/include/perfetto/tracing/core/trace_config.h"
...@@ -46,9 +47,12 @@ void ProducerHost::Initialize(mojom::ProducerClientPtr producer_client, ...@@ -46,9 +47,12 @@ void ProducerHost::Initialize(mojom::ProducerClientPtr producer_client,
// hence we avoid any deadlocking occurring from trace events emitted from // hence we avoid any deadlocking occurring from trace events emitted from
// the Perfetto sequence filling up the SMB and stalling while waiting for // the Perfetto sequence filling up the SMB and stalling while waiting for
// Perfetto to free the chunks. // Perfetto to free the chunks.
base::ProcessId pid; if (!base::FeatureList::IsEnabled(
if (PerfettoService::ParsePidFromProducerName(name, &pid)) { features::kPerfettoForceOutOfProcessProducer)) {
is_in_process_ = (pid == base::Process::Current().Pid()); base::ProcessId pid;
if (PerfettoService::ParsePidFromProducerName(name, &pid)) {
is_in_process_ = (pid == base::Process::Current().Pid());
}
} }
// TODO(oysteine): Figure out an uid once we need it. // TODO(oysteine): Figure out an uid once we need it.
......
...@@ -24,6 +24,10 @@ const base::Feature kTracingPerfettoBackend{"TracingPerfettoBackend", ...@@ -24,6 +24,10 @@ const base::Feature kTracingPerfettoBackend{"TracingPerfettoBackend",
const base::Feature kBackgroundTracingProtoOutput{ const base::Feature kBackgroundTracingProtoOutput{
"BackgroundTracingProtoOutput", base::FEATURE_DISABLED_BY_DEFAULT}; "BackgroundTracingProtoOutput", base::FEATURE_DISABLED_BY_DEFAULT};
// Causes Perfetto to run in-process mode for in-process tracing producers.
const base::Feature kPerfettoForceOutOfProcessProducer{
"PerfettoForceOutOfProcessProducer", base::FEATURE_ENABLED_BY_DEFAULT};
// Runs the tracing service as an in-process browser service. // Runs the tracing service as an in-process browser service.
const base::Feature kTracingServiceInProcess { const base::Feature kTracingServiceInProcess {
"TracingServiceInProcess", "TracingServiceInProcess",
......
...@@ -24,6 +24,9 @@ extern const COMPONENT_EXPORT(TRACING_CPP) base::Feature ...@@ -24,6 +24,9 @@ extern const COMPONENT_EXPORT(TRACING_CPP) base::Feature
extern const COMPONENT_EXPORT(TRACING_CPP) base::Feature extern const COMPONENT_EXPORT(TRACING_CPP) base::Feature
kBackgroundTracingProtoOutput; kBackgroundTracingProtoOutput;
extern const COMPONENT_EXPORT(TRACING_CPP) base::Feature
kPerfettoForceOutOfProcessProducer;
} // namespace features } // namespace features
namespace tracing { namespace tracing {
......
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