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

Side by Side Diff: content/app/android/library_loader_hooks.cc

Issue 1165673002: [Startup Tracing] Hook up TraceConfig and remove CategoryFilter & TraceOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | content/app/content_main_runner.cc » ('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/app/android/library_loader_hooks.h" 5 #include "content/app/android/library_loader_hooks.h"
6 6
7 #include "base/android/base_jni_registrar.h" 7 #include "base/android/base_jni_registrar.h"
8 #include "base/android/command_line_android.h" 8 #include "base/android/command_line_android.h"
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_registrar.h" 10 #include "base/android/jni_registrar.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 g_jni_init_done = true; 84 g_jni_init_done = true;
85 } 85 }
86 86
87 return true; 87 return true;
88 } 88 }
89 89
90 bool LibraryLoaded(JNIEnv* env, jclass clazz) { 90 bool LibraryLoaded(JNIEnv* env, jclass clazz) {
91 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 91 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
92 92
93 if (command_line->HasSwitch(switches::kTraceStartup)) { 93 if (command_line->HasSwitch(switches::kTraceStartup)) {
94 base::trace_event::CategoryFilter category_filter( 94 base::trace_event::TraceConfig trace_config(
95 command_line->GetSwitchValueASCII(switches::kTraceStartup)); 95 command_line->GetSwitchValueASCII(switches::kTraceStartup), "");
96 base::trace_event::TraceLog::GetInstance()->SetEnabled( 96 base::trace_event::TraceLog::GetInstance()->SetEnabled(
97 category_filter, 97 trace_config, base::trace_event::TraceLog::RECORDING_MODE);
98 base::trace_event::TraceLog::RECORDING_MODE,
99 base::trace_event::TraceOptions());
100 } 98 }
101 99
102 // Android's main browser loop is custom so we set the browser 100 // Android's main browser loop is custom so we set the browser
103 // name here as early as possible. 101 // name here as early as possible.
104 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); 102 TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, "");
105 base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser"); 103 base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser");
106 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( 104 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex(
107 kTraceEventBrowserProcessSortIndex); 105 kTraceEventBrowserProcessSortIndex);
108 106
109 // Can only use event tracing after setting up the command line. 107 // Can only use event tracing after setting up the command line.
110 TRACE_EVENT0("jni", "JNI_OnLoad continuation"); 108 TRACE_EVENT0("jni", "JNI_OnLoad continuation");
111 109
112 logging::LoggingSettings settings; 110 logging::LoggingSettings settings;
113 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 111 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
114 logging::InitLogging(settings); 112 logging::InitLogging(settings);
115 // To view log output with IDs and timestamps use "adb logcat -v threadtime". 113 // To view log output with IDs and timestamps use "adb logcat -v threadtime".
116 logging::SetLogItems(false, // Process ID 114 logging::SetLogItems(false, // Process ID
117 false, // Thread ID 115 false, // Thread ID
118 false, // Timestamp 116 false, // Timestamp
119 false); // Tick count 117 false); // Tick count
120 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel() 118 VLOG(0) << "Chromium logging enabled: level = " << logging::GetMinLogLevel()
121 << ", default verbosity = " << logging::GetVlogVerbosity(); 119 << ", default verbosity = " << logging::GetVlogVerbosity();
122 120
123 return true; 121 return true;
124 } 122 }
125 123
126 } // namespace content 124 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698