Commit 293bb359 authored by Oystein Eftevaag's avatar Oystein Eftevaag Committed by Commit Bot

Increase the Perfetto page size from 4kb to 32kb

This should reduce the number of Mojo messages sent
to commit chunks from the SMB by a fair amount.

R=ssid@chromium.org

Bug: 966098
Change-Id: If242e37d2b368b93cb7e72079b2958083e4ea749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717916
Commit-Queue: oysteine <oysteine@chromium.org>
Reviewed-by: default avatarssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681912}
parent cccaa47c
......@@ -136,7 +136,7 @@ IN_PROC_BROWSER_TEST_F(StartupTracingInProcessTest, TestFilledStartupBuffer) {
TRACE_EVENT1("toplevel", "bar", "data", std::move(data));
}
config.SetTraceBufferSizeInKb(12);
config.SetTraceBufferSizeInKb(32);
base::RunLoop wait_for_tracing;
TracingControllerImpl::GetInstance()->StartTracing(
......
......@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/process/process.h"
#include "build/build_config.h"
#include "services/tracing/perfetto/perfetto_service.h"
#include "services/tracing/public/cpp/perfetto/producer_client.h"
#include "services/tracing/public/cpp/perfetto/shared_memory.h"
......@@ -18,6 +19,15 @@
namespace tracing {
// TODO(oysteine): Find a good compromise between performance and
// data granularity (mainly relevant to running with small buffer sizes
// when we use background tracing) on Android.
#if defined(OS_ANDROID)
constexpr size_t kSMBPageSizeInBytes = 4 * 1024;
#else
constexpr size_t kSMBPageSizeInBytes = 32 * 1024;
#endif
ProducerHost::ProducerHost() = default;
ProducerHost::~ProducerHost() {
......@@ -59,7 +69,9 @@ void ProducerHost::Initialize(mojom::ProducerClientPtr producer_client,
// TODO(oysteine): Figure out a good buffer size.
producer_endpoint_ = service->ConnectProducer(
this, 0 /* uid */, name,
4 * 1024 * 1024 /* shared_memory_size_hint_bytes */, is_in_process_);
/*shared_memory_size_hint_bytes=*/4 * 1024 * 1024, is_in_process_,
perfetto::TracingService::ProducerSMBScrapingMode::kDefault,
/*shared_memory_page_size_hint_bytes=*/kSMBPageSizeInBytes);
DCHECK(producer_endpoint_);
}
......
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