summaryrefslogtreecommitdiffstats
path: root/content/app
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-09 19:21:33 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-09 19:21:33 +0000
commit50f3842eba03378f345cfe61364cda455b342be2 (patch)
tree870bb60805a45b6693240e7edda1a014932fc112 /content/app
parent7979168e1dfbf9a61aa0adbf641b6d310191b8c4 (diff)
downloadchromium_src-50f3842eba03378f345cfe61364cda455b342be2.zip
chromium_src-50f3842eba03378f345cfe61364cda455b342be2.tar.gz
chromium_src-50f3842eba03378f345cfe61364cda455b342be2.tar.bz2
Support --trace-startup and task tracing
passing --trace-startup puts the tracing system into record mode immediately saving the result to chrometrace.log or a file specified by --trace-startup-file BUG=None TEST=start chrome with --trace-startup, wait 5 secs, see chrometrace.log in current dir. open it in chrome://tracing/ Review URL: http://codereview.chromium.org/7887013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app')
-rw-r--r--content/app/content_main.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/app/content_main.cc b/content/app/content_main.cc
index ace58ff..7e670c0 100644
--- a/content/app/content_main.cc
+++ b/content/app/content_main.cc
@@ -7,6 +7,7 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
+#include "base/debug/trace_event.h"
#include "base/i18n/icu_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -345,6 +346,12 @@ int ContentMain(int argc,
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
+ // Enable startup tracing asap to avoid early TRACE_EVENT calls being ignored.
+ if (command_line.HasSwitch(switches::kTraceStartup)) {
+ base::debug::TraceLog::GetInstance()->SetEnabled(
+ command_line.GetSwitchValueASCII(switches::kTraceStartup));
+ }
+
#if defined(OS_MACOSX)
// We need to allocate the IO Ports before the Sandbox is initialized or
// the first instance of SystemMonitor is created.