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

Unified Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 23691025: Adding shutdown tracing capabilities (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Started the profiling in AttemptUserExit instead of BrowserMainRunner::Shutdown. Created 7 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/lifetime/application_lifetime.cc
diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc
index 503a0740226713866267851e18ad0b8dec5db6e2..ec209985632a3b8d87bd74cc489dcf366e7ea689 100644
--- a/chrome/browser/lifetime/application_lifetime.cc
+++ b/chrome/browser/lifetime/application_lifetime.cc
@@ -124,6 +124,16 @@ void CloseAllBrowsers() {
}
void AttemptUserExit() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kTraceShutdown)) {
+ base::debug::CategoryFilter category_filter(
+ command_line.GetSwitchValueASCII(switches::kTraceShutdown));
+ base::debug::TraceLog::GetInstance()->SetEnabled(
+ category_filter,
+ base::debug::TraceLog::RECORD_UNTIL_FULL);
DaveMoore 2013/08/30 22:51:15 Be sure to turn off tracing if the attempt to exit
Mr4D (OOO till 08-26) 2013/08/31 02:03:44 Good one. I haven't figured out yet how it can fai
+ }
+ TRACE_EVENT0("shutdown", "AttemptUserExit");
DaveMoore 2013/08/30 22:51:15 It sure would be good to get system tracing on Chr
Mr4D (OOO till 08-26) 2013/08/31 02:03:44 We can add "system events" also - in a later CL as
+
#if defined(OS_CHROMEOS)
chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false);
// Write /tmp/uptime-logout-started as well.

Powered by Google App Engine
This is Rietveld 408576698