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

Side by Side Diff: content/app/content_main_runner.cc

Issue 1317333002: Reland [Startup Tracing] Add --trace-config-file flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test Created 5 years, 3 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
« no previous file with comments | « content/app/android/library_loader_hooks.cc ('k') | content/browser/browser_main_loop.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/app/content_main_runner.h" 5 #include "content/public/app/content_main_runner.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/allocator/allocator_extension.h" 9 #include "base/allocator/allocator_extension.h"
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 10 matching lines...) Expand all
21 #include "base/path_service.h" 21 #include "base/path_service.h"
22 #include "base/process/launch.h" 22 #include "base/process/launch.h"
23 #include "base/process/memory.h" 23 #include "base/process/memory.h"
24 #include "base/process/process_handle.h" 24 #include "base/process/process_handle.h"
25 #include "base/profiler/alternate_timer.h" 25 #include "base/profiler/alternate_timer.h"
26 #include "base/profiler/scoped_tracker.h" 26 #include "base/profiler/scoped_tracker.h"
27 #include "base/strings/string_number_conversions.h" 27 #include "base/strings/string_number_conversions.h"
28 #include "base/strings/string_util.h" 28 #include "base/strings/string_util.h"
29 #include "base/strings/stringprintf.h" 29 #include "base/strings/stringprintf.h"
30 #include "base/trace_event/trace_event.h" 30 #include "base/trace_event/trace_event.h"
31 #include "components/tracing/startup_tracing.h" 31 #include "components/tracing/trace_config_file.h"
32 #include "components/tracing/tracing_switches.h" 32 #include "components/tracing/tracing_switches.h"
33 #include "content/browser/browser_main.h" 33 #include "content/browser/browser_main.h"
34 #include "content/common/set_process_title.h" 34 #include "content/common/set_process_title.h"
35 #include "content/common/url_schemes.h" 35 #include "content/common/url_schemes.h"
36 #include "content/gpu/in_process_gpu_thread.h" 36 #include "content/gpu/in_process_gpu_thread.h"
37 #include "content/public/app/content_main.h" 37 #include "content/public/app/content_main.h"
38 #include "content/public/app/content_main_delegate.h" 38 #include "content/public/app/content_main_delegate.h"
39 #include "content/public/app/startup_helper_win.h" 39 #include "content/public/app/startup_helper_win.h"
40 #include "content/public/browser/content_browser_client.h" 40 #include "content/public/browser/content_browser_client.h"
41 #include "content/public/common/content_client.h" 41 #include "content/public/common/content_client.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 // ignored. 622 // ignored.
623 if (command_line.HasSwitch(switches::kTraceStartup)) { 623 if (command_line.HasSwitch(switches::kTraceStartup)) {
624 base::trace_event::TraceConfig trace_config( 624 base::trace_event::TraceConfig trace_config(
625 command_line.GetSwitchValueASCII(switches::kTraceStartup), 625 command_line.GetSwitchValueASCII(switches::kTraceStartup),
626 base::trace_event::RECORD_UNTIL_FULL); 626 base::trace_event::RECORD_UNTIL_FULL);
627 base::trace_event::TraceLog::GetInstance()->SetEnabled( 627 base::trace_event::TraceLog::GetInstance()->SetEnabled(
628 trace_config, 628 trace_config,
629 base::trace_event::TraceLog::RECORDING_MODE); 629 base::trace_event::TraceLog::RECORDING_MODE);
630 } else if (process_type != switches::kZygoteProcess && 630 } else if (process_type != switches::kZygoteProcess &&
631 process_type != switches::kRendererProcess) { 631 process_type != switches::kRendererProcess) {
632 // There is no need to schedule stopping tracing in this case. Telemetry 632 if (tracing::TraceConfigFile::GetInstance()->IsEnabled()) {
633 // will stop tracing on demand later. 633 base::trace_event::TraceLog::GetInstance()->SetEnabled(
634 tracing::EnableStartupTracingIfConfigFileExists(); 634 tracing::TraceConfigFile::GetInstance()->GetTraceConfig(),
635 base::trace_event::TraceLog::RECORDING_MODE);
636 }
635 } 637 }
636 638
637 #if defined(OS_WIN) 639 #if defined(OS_WIN)
638 // Enable exporting of events to ETW if requested on the command line. 640 // Enable exporting of events to ETW if requested on the command line.
639 if (command_line.HasSwitch(switches::kTraceExportEventsToETW)) 641 if (command_line.HasSwitch(switches::kTraceExportEventsToETW))
640 base::trace_event::TraceEventETWExport::EnableETWExport(); 642 base::trace_event::TraceEventETWExport::EnableETWExport();
641 #endif // OS_WIN 643 #endif // OS_WIN
642 644
643 #if !defined(OS_ANDROID) 645 #if !defined(OS_ANDROID)
644 // Android tracing started at the beginning of the method. 646 // Android tracing started at the beginning of the method.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 865
864 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 866 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
865 }; 867 };
866 868
867 // static 869 // static
868 ContentMainRunner* ContentMainRunner::Create() { 870 ContentMainRunner* ContentMainRunner::Create() {
869 return new ContentMainRunnerImpl(); 871 return new ContentMainRunnerImpl();
870 } 872 }
871 873
872 } // namespace content 874 } // namespace content
OLDNEW
« no previous file with comments | « content/app/android/library_loader_hooks.cc ('k') | content/browser/browser_main_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698