Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2918)

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1029653002: Enable startup profiling by Win x64 stack sampling profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@statprof-metrics-provider
Patch Set: do IsSamplingProfilingReportingEnabled() check when appending profiles Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index fb5034032e2085bdb551bd929c5420f4eb78b692..45d43ff09686daf433a9d3816d9c99bff7eb10ed 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -577,11 +577,14 @@ ChromeBrowserMainParts::ChromeBrowserMainParts(
startup_watcher_(new StartupTimeBomb()),
shutdown_watcher_(new ShutdownWatcherHelper()),
browser_field_trials_(parameters.command_line),
+ sampling_profiler_(base::PlatformThread::CurrentId(),
+ GetStartupSamplingParams()),
profile_(NULL),
run_message_loop_(true),
notify_result_(ProcessSingleton::PROCESS_NONE),
local_state_(NULL),
restart_last_session_(false) {
+ sampling_profiler_.Start();
// If we're running tests (ui_task is non-null).
if (parameters.ui_task)
browser_defaults::enable_help_app = false;
@@ -724,6 +727,19 @@ void ChromeBrowserMainParts::RecordBrowserStartupTime() {
new LoadCompleteListener();
}
+// static
+base::StackSamplingProfiler::SamplingParams
+ChromeBrowserMainParts::GetStartupSamplingParams() {
+ // Sample at 10Hz for 30 seconds.
+ base::StackSamplingProfiler::SamplingParams params;
+ params.initial_delay = base::TimeDelta::FromMilliseconds(0);
+ params.bursts = 1;
+ params.samples_per_burst = 300;
+ params.sampling_interval = base::TimeDelta::FromMilliseconds(100);
+ params.preserve_sample_ordering = false;
+ return params;
+}
+
// -----------------------------------------------------------------------------
// TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts.

Powered by Google App Engine
This is Rietveld 408576698