Commit 5366727d authored by Oksana Zhuravlova's avatar Oksana Zhuravlova Committed by Commit Bot

[perf] Add more native startup traces

This change adds trace entries under content::Start.
Also moves the call to TraceEvent.setATraceEnabled to the very beginning
of startChromiumLocked().

Bug: 1019793
Change-Id: I06d3a9d4cb20075f2dc2ce999ffe5efe3d1dd0bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962858Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726458}
parent 6962128c
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "cc/base/switches.h" #include "cc/base/switches.h"
#include "components/autofill/core/common/autofill_prefs.h" #include "components/autofill/core/common/autofill_prefs.h"
#include "components/metrics/metrics_pref_names.h" #include "components/metrics/metrics_pref_names.h"
...@@ -212,6 +213,8 @@ void AwFeatureListCreator::CreateLocalState() { ...@@ -212,6 +213,8 @@ void AwFeatureListCreator::CreateLocalState() {
} }
void AwFeatureListCreator::CreateFeatureListAndFieldTrials() { void AwFeatureListCreator::CreateFeatureListAndFieldTrials() {
TRACE_EVENT0("startup",
"AwFeatureListCreator::CreateFeatureListAndFieldTrials");
CreateLocalState(); CreateLocalState();
AwMetricsServiceClient::GetInstance()->Initialize(local_state_.get()); AwMetricsServiceClient::GetInstance()->Initialize(local_state_.get());
SetUpFieldTrials(); SetUpFieldTrials();
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/posix/global_descriptors.h" #include "base/posix/global_descriptors.h"
#include "base/trace_event/trace_event.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/resource/resource_bundle_android.h" #include "ui/base/resource/resource_bundle_android.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
namespace android_webview { namespace android_webview {
void InitIcuAndResourceBundleBrowserSide() { void InitIcuAndResourceBundleBrowserSide() {
TRACE_EVENT0("startup", "InitIcuAndResourceBundleBrowserSide");
ui::SetLocalePaksStoredInApk(true); ui::SetLocalePaksStoredInApk(true);
std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale( std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale(
base::android::GetDefaultLocaleString(), NULL, base::android::GetDefaultLocaleString(), NULL,
......
...@@ -124,6 +124,7 @@ public class WebViewChromiumAwInit { ...@@ -124,6 +124,7 @@ public class WebViewChromiumAwInit {
protected void startChromiumLocked() { protected void startChromiumLocked() {
try (ScopedSysTraceEvent event = try (ScopedSysTraceEvent event =
ScopedSysTraceEvent.scoped("WebViewChromiumAwInit.startChromiumLocked")) { ScopedSysTraceEvent.scoped("WebViewChromiumAwInit.startChromiumLocked")) {
TraceEvent.setATraceEnabled(mFactory.getWebViewDelegate().isTraceTagEnabled());
assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread();
// The post-condition of this method is everything is ready, so notify now to cover all // The post-condition of this method is everything is ready, so notify now to cover all
...@@ -167,8 +168,6 @@ public class WebViewChromiumAwInit { ...@@ -167,8 +168,6 @@ public class WebViewChromiumAwInit {
// available when AwFeatureListCreator::SetUpFieldTrials() runs. // available when AwFeatureListCreator::SetUpFieldTrials() runs.
finishVariationsInitLocked(); finishVariationsInitLocked();
TraceEvent.setATraceEnabled(mFactory.getWebViewDelegate().isTraceTagEnabled());
AwBrowserProcess.start(); AwBrowserProcess.start();
AwBrowserProcess.handleMinidumpsAndSetMetricsConsent(true /* updateMetricsConsent */); AwBrowserProcess.handleMinidumpsAndSetMetricsConsent(true /* updateMetricsConsent */);
......
...@@ -883,6 +883,7 @@ int ContentMainRunnerImpl::Run(bool start_service_manager_only) { ...@@ -883,6 +883,7 @@ int ContentMainRunnerImpl::Run(bool start_service_manager_only) {
#if !defined(CHROME_MULTIPLE_DLL_CHILD) #if !defined(CHROME_MULTIPLE_DLL_CHILD)
int ContentMainRunnerImpl::RunServiceManager(MainFunctionParams& main_params, int ContentMainRunnerImpl::RunServiceManager(MainFunctionParams& main_params,
bool start_service_manager_only) { bool start_service_manager_only) {
TRACE_EVENT0("startup", "ContentMainRunnerImpl::RunServiceManager");
if (is_browser_main_loop_started_) if (is_browser_main_loop_started_)
return -1; return -1;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "content/browser/tracing/memory_instrumentation_util.h" #include "content/browser/tracing/memory_instrumentation_util.h"
#include "base/trace_event/trace_event.h"
#include "content/public/browser/resource_coordinator_service.h" #include "content/public/browser/resource_coordinator_service.h"
#include "services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.h" #include "services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.h"
#include "services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.h" #include "services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.h"
...@@ -11,6 +12,7 @@ ...@@ -11,6 +12,7 @@
namespace content { namespace content {
void InitializeBrowserMemoryInstrumentationClient() { void InitializeBrowserMemoryInstrumentationClient() {
TRACE_EVENT0("startup", "InitializeBrowserMemoryInstrumentationClient");
mojo::PendingRemote<memory_instrumentation::mojom::Coordinator> coordinator; mojo::PendingRemote<memory_instrumentation::mojom::Coordinator> coordinator;
mojo::PendingRemote<memory_instrumentation::mojom::ClientProcess> process; mojo::PendingRemote<memory_instrumentation::mojom::ClientProcess> process;
auto process_receiver = process.InitWithNewPipeAndPassReceiver(); auto process_receiver = process.InitWithNewPipeAndPassReceiver();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/android/jni_android.h" #include "base/android/jni_android.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "ui/android/screen_android.h" #include "ui/android/screen_android.h"
#include "ui/android/ui_android_jni_headers/DisplayAndroidManager_jni.h" #include "ui/android/ui_android_jni_headers/DisplayAndroidManager_jni.h"
#include "ui/android/window_android.h" #include "ui/android/window_android.h"
...@@ -22,6 +23,7 @@ using display::Display; ...@@ -22,6 +23,7 @@ using display::Display;
using display::DisplayList; using display::DisplayList;
void SetScreenAndroid(bool use_display_wide_color_gamut) { void SetScreenAndroid(bool use_display_wide_color_gamut) {
TRACE_EVENT0("startup", "SetScreenAndroid");
// Do not override existing Screen. // Do not override existing Screen.
DCHECK_EQ(display::Screen::GetScreen(), nullptr); DCHECK_EQ(display::Screen::GetScreen(), nullptr);
......
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