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

Unified Diff: content/app/content_main_runner.cc

Issue 2683913002: Enable startup tracing from command line flags in components/tracing (Closed)
Patch Set: Rebase. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/app/android/library_loader_hooks.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 5d799dc812168423e5a3d6c61d192a9dbee2ab6a..9c3d133e84f52e55549bc475426132d9b01c75d6 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -42,9 +42,7 @@
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
-#include "components/tracing/browser/trace_config_file.h"
-#include "components/tracing/common/trace_to_console.h"
-#include "components/tracing/common/tracing_switches.h"
+#include "components/tracing/common/trace_startup.h"
#include "content/app/mojo/mojo_init.h"
#include "content/common/set_process_title.h"
#include "content/common/url_schemes.h"
@@ -661,31 +659,12 @@ class ContentMainRunnerImpl : public ContentMainRunner {
// Enable startup tracing asap to avoid early TRACE_EVENT calls being
// ignored. For Android, startup tracing is enabled in an even earlier place
// content/app/android/library_loader_hooks.cc.
- if (command_line.HasSwitch(switches::kTraceStartup)) {
- base::trace_event::TraceConfig trace_config(
- command_line.GetSwitchValueASCII(switches::kTraceStartup),
- base::trace_event::RECORD_UNTIL_FULL);
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- trace_config,
- base::trace_event::TraceLog::RECORDING_MODE);
- } else if (command_line.HasSwitch(switches::kTraceToConsole)) {
- base::trace_event::TraceConfig trace_config =
- tracing::GetConfigForTraceToConsole();
- LOG(ERROR) << "Start " << switches::kTraceToConsole
- << " with CategoryFilter '"
- << trace_config.ToCategoryFilterString() << "'.";
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- trace_config,
- base::trace_event::TraceLog::RECORDING_MODE);
- } else if (process_type != switches::kZygoteProcess &&
- process_type != switches::kRendererProcess) {
- if (tracing::TraceConfigFile::GetInstance()->IsEnabled()) {
- // This checks kTraceConfigFile switch.
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- tracing::TraceConfigFile::GetInstance()->GetTraceConfig(),
- base::trace_event::TraceLog::RECORDING_MODE);
- }
- }
+ // Zygote process does not have file thread and renderer process on Win10
+ // cannot access the file system.
+ // TODO(ssid): Check if other processes can enable startup tracing here.
+ bool can_access_file_system = (process_type != switches::kZygoteProcess &&
+ process_type != switches::kRendererProcess);
+ tracing::EnableStartupTracingIfNeeded(can_access_file_system);
#endif // !OS_ANDROID
#if defined(OS_WIN)
« no previous file with comments | « content/app/android/library_loader_hooks.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698