Adding shutdown tracing capabilities
use "--trace-shutdown" to enable the feature to start profiling when the user has pressed "shutdown" and specify "--trace-shutdown-file=<name>" to specify the file where you want to dump to. Additionally you can specify which modules to trace with e.g. "--trace-shutdown=base,net".
That said: NOTE that the dumping will cost time since it has to be done after the shutdown of Chrome is finished. As such it takes time and will make it impossible to get a correct reading of time from shutdown till a new startup is finished.
Note: This is similar to the trace-startup - with the exception that upon shutdown it is not possible to rely on threads for IO anymore.
BUG=281524
TEST=visual tests
Review URL: https://chromiumcodereview.appspot.com/23691025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221631 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index f005b88..96756eee 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -197,6 +197,7 @@
}
void BrowserProcessImpl::StartTearDown() {
+ TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown");
#if defined(ENABLE_AUTOMATION)
// Delete the AutomationProviderList before NotificationService,
// since it may try to unregister notifications
@@ -235,7 +236,11 @@
notification_ui_manager_.reset();
// Need to clear profiles (download managers) before the io_thread_.
- profile_manager_.reset();
+ {
+ TRACE_EVENT0("shutdown",
+ "BrowserProcessImpl::StartTearDown:ProfileManager");
+ profile_manager_.reset();
+ }
#if !defined(OS_ANDROID)
// Debugger must be cleaned up before IO thread and NotificationService.