Commit 6b3f679e authored by Oystein Eftevaag's avatar Oystein Eftevaag Committed by Commit Bot

Perfetto: New switch for startup tracing directly to file

Reviewed as part of https://chromium-review.googlesource.com/c/chromium/src/+/1161541

TBR=skyostil@chromium.org

Change-Id: I81973d090fe632b63a2cb5d501f32df13de795e2
Reviewed-on: https://chromium-review.googlesource.com/c/1308656Reviewed-by: default avataroysteine <oysteine@chromium.org>
Commit-Queue: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604045}
parent da525455
...@@ -19,6 +19,13 @@ void EnableStartupTracingIfNeeded() { ...@@ -19,6 +19,13 @@ void EnableStartupTracingIfNeeded() {
const base::CommandLine& command_line = const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess(); *base::CommandLine::ForCurrentProcess();
// TODO(oysteine): Startup tracing using Perfetto
// is enabled by the Mojo consumer in content/browser
// for now; this is too late in the browser startup
// process however.
if (command_line.HasSwitch(switches::kPerfettoOutputFile))
return;
// Ensure TraceLog is initialized first. // Ensure TraceLog is initialized first.
// https://crbug.com/764357 // https://crbug.com/764357
base::trace_event::TraceLog::GetInstance(); base::trace_event::TraceLog::GetInstance();
......
...@@ -54,6 +54,12 @@ const char kTraceStartupFile[] = "trace-startup-file"; ...@@ -54,6 +54,12 @@ const char kTraceStartupFile[] = "trace-startup-file";
// "record-until-full" mode will be used. // "record-until-full" mode will be used.
const char kTraceStartupRecordMode[] = "trace-startup-record-mode"; const char kTraceStartupRecordMode[] = "trace-startup-record-mode";
// If supplied, will enable Perfetto startup tracing and stream the
// output to the given file.
// TODO(oysteine): Remove once Perfetto starts early enough after
// process startup to be able to replace the legacy startup tracing.
const char kPerfettoOutputFile[] = "perfetto-output-file";
// Sends a pretty-printed version of tracing info to the console. // Sends a pretty-printed version of tracing info to the console.
const char kTraceToConsole[] = "trace-to-console"; const char kTraceToConsole[] = "trace-to-console";
......
...@@ -17,6 +17,7 @@ TRACING_EXPORT extern const char kTraceStartup[]; ...@@ -17,6 +17,7 @@ TRACING_EXPORT extern const char kTraceStartup[];
TRACING_EXPORT extern const char kTraceStartupDuration[]; TRACING_EXPORT extern const char kTraceStartupDuration[];
TRACING_EXPORT extern const char kTraceStartupFile[]; TRACING_EXPORT extern const char kTraceStartupFile[];
TRACING_EXPORT extern const char kTraceStartupRecordMode[]; TRACING_EXPORT extern const char kTraceStartupRecordMode[];
TRACING_EXPORT extern const char kPerfettoOutputFile[];
TRACING_EXPORT extern const char kTraceToConsole[]; TRACING_EXPORT extern const char kTraceToConsole[];
TRACING_EXPORT extern const char kTraceUploadURL[]; TRACING_EXPORT extern const char kTraceUploadURL[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment