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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1263403002: Stack sampling profiler: re-enable stack collection for stacks terminated by leaf functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix GN link Created 5 years, 4 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
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 669b84e44ee92fa57fc7e7a1b1b72c036fd838b0..bf45e8f1548b40d5354cca427f306e5dd195160b 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -541,6 +541,16 @@ void LaunchDevToolsHandlerIfNeeded(const base::CommandLine& command_line) {
}
}
+base::StackSamplingProfiler::SamplingParams 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);
+ return params;
+}
+
} // namespace
namespace chrome_browser {
@@ -569,11 +579,25 @@ ChromeBrowserMainParts::ChromeBrowserMainParts(
startup_watcher_(new StartupTimeBomb()),
shutdown_watcher_(new ShutdownWatcherHelper()),
browser_field_trials_(parameters.command_line),
+ sampling_profiler_(
+ base::PlatformThread::CurrentId(),
+ GetStartupSamplingParams(),
+ metrics::CallStackProfileMetricsProvider::GetProfilerCallback(
+ metrics::CallStackProfileMetricsProvider::Params(
+ metrics::CallStackProfileMetricsProvider::PROCESS_STARTUP,
+ false))),
profile_(NULL),
run_message_loop_(true),
notify_result_(ProcessSingleton::PROCESS_NONE),
local_state_(NULL),
restart_last_session_(false) {
+ const version_info::Channel channel = chrome::GetChannel();
+ if (channel == version_info::Channel::UNKNOWN ||
+ channel == version_info::Channel::CANARY ||
+ channel == version_info::Channel::DEV) {
+ sampling_profiler_.Start();
+ }
+
// If we're running tests (ui_task is non-null).
if (parameters.ui_task)
browser_defaults::enable_help_app = false;
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698