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

Side by Side Diff: content/app/content_main_runner.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 (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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 // Enable startup tracing asap to avoid early TRACE_EVENT calls being 625 // Enable startup tracing asap to avoid early TRACE_EVENT calls being
626 // ignored. 626 // ignored.
627 if (command_line.HasSwitch(switches::kTraceStartup)) { 627 if (command_line.HasSwitch(switches::kTraceStartup)) {
628 base::trace_event::TraceConfig trace_config( 628 base::trace_event::TraceConfig trace_config(
629 command_line.GetSwitchValueASCII(switches::kTraceStartup), 629 command_line.GetSwitchValueASCII(switches::kTraceStartup),
630 base::trace_event::RECORD_UNTIL_FULL); 630 base::trace_event::RECORD_UNTIL_FULL);
631 base::trace_event::TraceLog::GetInstance()->SetEnabled( 631 base::trace_event::TraceLog::GetInstance()->SetEnabled(
632 trace_config, 632 trace_config,
633 base::trace_event::TraceLog::RECORDING_MODE); 633 base::trace_event::TraceLog::RECORDING_MODE);
634 } else if (process_type != switches::kZygoteProcess) {
635 base::trace_event::EnableStartupTracingIfConfigFileExists();
634 } 636 }
637
635 #if defined(OS_WIN) 638 #if defined(OS_WIN)
636 // Enable exporting of events to ETW if requested on the command line. 639 // Enable exporting of events to ETW if requested on the command line.
637 if (command_line.HasSwitch(switches::kTraceExportEventsToETW)) 640 if (command_line.HasSwitch(switches::kTraceExportEventsToETW))
638 base::trace_event::TraceEventETWExport::EnableETWExport(); 641 base::trace_event::TraceEventETWExport::EnableETWExport();
639 #endif // OS_WIN 642 #endif // OS_WIN
640 643
641 #if !defined(OS_ANDROID) 644 #if !defined(OS_ANDROID)
642 // Android tracing started at the beginning of the method. 645 // Android tracing started at the beginning of the method.
643 // Other OSes have to wait till we get here in order for all the memory 646 // Other OSes have to wait till we get here in order for all the memory
644 // management setup to be completed. 647 // management setup to be completed.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 864
862 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 865 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
863 }; 866 };
864 867
865 // static 868 // static
866 ContentMainRunner* ContentMainRunner::Create() { 869 ContentMainRunner* ContentMainRunner::Create() {
867 return new ContentMainRunnerImpl(); 870 return new ContentMainRunnerImpl();
868 } 871 }
869 872
870 } // namespace content 873 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698