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

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: test unwinding 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
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 0c7098c582528da5ee10c1685c92db4fc61ba0c3..9632734e6df826f2377f2c564335e4778c84df2e 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -540,6 +540,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 {
@@ -568,11 +578,26 @@ 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::VersionInfo::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;
« base/profiler/win32_stack_frame_unwinder_unittest.cc ('K') | « chrome/browser/chrome_browser_main.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698