summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2016-03-18 06:50:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-18 13:52:13 +0000
commitc326671407f8790fbb7ee14ca59ac37aa25afa87 (patch)
tree6455dc39ed6b2f67b210f6b7ce604dabf7a717b3 /mojo
parent0e8c9a231127cb3538d6ebd5c4a614e6b3226109 (diff)
downloadchromium_src-c326671407f8790fbb7ee14ca59ac37aa25afa87.zip
chromium_src-c326671407f8790fbb7ee14ca59ac37aa25afa87.tar.gz
chromium_src-c326671407f8790fbb7ee14ca59ac37aa25afa87.tar.bz2
Instrument EDK sync Broker initialization
Bringing up Mojo at process startup caused a regression on OS X renderer startup times. At least half of the regression seems to be attributable to blocking on getting the parent pipe handle from the sync broker channel. We can eliminate this behavior on OS X now that we're using Mach shm, but let's also make sure it's not causing problems elsewhere in the wild. BUG=591742 Review URL: https://codereview.chromium.org/1805923006 Cr-Commit-Position: refs/heads/master@{#381953}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/edk/system/node_controller.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 698238d..58c87e2 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -14,6 +14,7 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/process/process_handle.h"
+#include "base/timer/elapsed_timer.h"
#include "crypto/random.h"
#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
@@ -143,8 +144,11 @@ void NodeController::ConnectToParent(ScopedPlatformHandle platform_handle) {
#if defined(OS_POSIX) && !defined(OS_MACOSX)
// On posix, use the bootstrap channel for the broker and receive the node's
// channel synchronously as the first message from the broker.
+ base::ElapsedTimer timer;
broker_.reset(new Broker(std::move(platform_handle)));
platform_handle = broker_->GetParentPlatformHandle();
+ UMA_HISTOGRAM_TIMES("Mojo.System.GetParentPlatformHandleSyncTime",
+ timer.Elapsed());
#endif
io_task_runner_->PostTask(