summaryrefslogtreecommitdiffstats
path: root/content/app
diff options
context:
space:
mode:
authorzhenw <zhenw@chromium.org>2015-08-27 20:07:16 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-28 03:07:55 +0000
commitde52fb95509666be1062b50a78bea36adfbac183 (patch)
tree626db79aacf3f16bea4ac54e5d5b77572df9faa1 /content/app
parent9478f58e1bfc86d7732dd864a374a445e88ddceb (diff)
downloadchromium_src-de52fb95509666be1062b50a78bea36adfbac183.zip
chromium_src-de52fb95509666be1062b50a78bea36adfbac183.tar.gz
chromium_src-de52fb95509666be1062b50a78bea36adfbac183.tar.bz2
[Startup Tracing] Add --trace-config-file flag
This CL adds --trace-config-file flag. Please see trace_config_file.h for details. Design doc: https://docs.google.com/document/d/1PgdXUOJF3WtEmYWUyGRbC2Fz2ICCZKO9jPvpLPRSHH8/edit?usp=sharing BUG=317481, 482098 Review URL: https://codereview.chromium.org/1315463002 Cr-Commit-Position: refs/heads/master@{#346062}
Diffstat (limited to 'content/app')
-rw-r--r--content/app/android/library_loader_hooks.cc8
-rw-r--r--content/app/content_main_runner.cc10
2 files changed, 12 insertions, 6 deletions
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc
index 39ef2b0..2a1a3df 100644
--- a/content/app/android/library_loader_hooks.cc
+++ b/content/app/android/library_loader_hooks.cc
@@ -16,7 +16,7 @@
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "base/tracked_objects.h"
-#include "components/tracing/startup_tracing.h"
+#include "components/tracing/trace_config_file.h"
#include "components/tracing/tracing_switches.h"
#include "content/app/android/app_jni_registrar.h"
#include "content/browser/android/browser_jni_registrar.h"
@@ -94,7 +94,11 @@ bool LibraryLoaded(JNIEnv* env, jclass clazz) {
base::trace_event::TraceLog::GetInstance()->SetEnabled(
trace_config, base::trace_event::TraceLog::RECORDING_MODE);
} else {
- tracing::EnableStartupTracingIfConfigFileExists();
+ if (tracing::TraceConfigFile::GetInstance()->IsEnabled()) {
+ base::trace_event::TraceLog::GetInstance()->SetEnabled(
+ tracing::TraceConfigFile::GetInstance()->GetTraceConfig(),
+ base::trace_event::TraceLog::RECORDING_MODE);
+ }
}
// Android's main browser loop is custom so we set the browser
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 1a5e950..f35ed29 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -28,7 +28,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
-#include "components/tracing/startup_tracing.h"
+#include "components/tracing/trace_config_file.h"
#include "components/tracing/tracing_switches.h"
#include "content/browser/browser_main.h"
#include "content/common/set_process_title.h"
@@ -629,9 +629,11 @@ class ContentMainRunnerImpl : public ContentMainRunner {
base::trace_event::TraceLog::RECORDING_MODE);
} else if (process_type != switches::kZygoteProcess &&
process_type != switches::kRendererProcess) {
- // There is no need to schedule stopping tracing in this case. Telemetry
- // will stop tracing on demand later.
- tracing::EnableStartupTracingIfConfigFileExists();
+ if (tracing::TraceConfigFile::GetInstance()->IsEnabled()) {
+ base::trace_event::TraceLog::GetInstance()->SetEnabled(
+ tracing::TraceConfigFile::GetInstance()->GetTraceConfig(),
+ base::trace_event::TraceLog::RECORDING_MODE);
+ }
}
#if defined(OS_WIN)