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

Side by Side Diff: mojo/runner/desktop/launcher_process.cc

Issue 1177853003: [Startup Tracing] Enable startup tracing from config file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review fix Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <iostream> 9 #include <iostream>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 int LauncherProcessMain(int argc, char** argv) { 80 int LauncherProcessMain(int argc, char** argv) {
81 const base::CommandLine& command_line = 81 const base::CommandLine& command_line =
82 *base::CommandLine::ForCurrentProcess(); 82 *base::CommandLine::ForCurrentProcess();
83 if (command_line.HasSwitch(switches::kTraceStartup)) { 83 if (command_line.HasSwitch(switches::kTraceStartup)) {
84 g_tracing = true; 84 g_tracing = true;
85 base::trace_event::TraceConfig trace_config( 85 base::trace_event::TraceConfig trace_config(
86 command_line.GetSwitchValueASCII(switches::kTraceStartup), 86 command_line.GetSwitchValueASCII(switches::kTraceStartup),
87 base::trace_event::RECORD_UNTIL_FULL); 87 base::trace_event::RECORD_UNTIL_FULL);
88 base::trace_event::TraceLog::GetInstance()->SetEnabled( 88 base::trace_event::TraceLog::GetInstance()->SetEnabled(
89 trace_config, base::trace_event::TraceLog::RECORDING_MODE); 89 trace_config, base::trace_event::TraceLog::RECORDING_MODE);
90 } else {
91 base::trace_event::EnableStartupTracingIfConfigFileExists();
90 } 92 }
91 93
92 // We want the shell::Context to outlive the MessageLoop so that pipes are 94 // We want the shell::Context to outlive the MessageLoop so that pipes are
93 // all gracefully closed / error-out before we try to shut the Context down. 95 // all gracefully closed / error-out before we try to shut the Context down.
94 Context shell_context; 96 Context shell_context;
95 { 97 {
96 base::MessageLoop message_loop; 98 base::MessageLoop message_loop;
97 if (!shell_context.Init()) { 99 if (!shell_context.Init()) {
98 return 0; 100 return 0;
99 } 101 }
(...skipping 12 matching lines...) Expand all
112 shell_context.Shutdown(); 114 shell_context.Shutdown();
113 } 115 }
114 116
115 if (g_tracing) 117 if (g_tracing)
116 StopTracingAndFlushToDisk(); 118 StopTracingAndFlushToDisk();
117 return 0; 119 return 0;
118 } 120 }
119 121
120 } // namespace runner 122 } // namespace runner
121 } // namespace mojo 123 } // namespace mojo
OLDNEW
« base/trace_event/startup_tracing.cc ('K') | « mandoline/app/desktop/launcher_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698