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

Side by Side Diff: components/tracing/trace_to_console.cc

Issue 2028043002: tracing: restructure to the components/tracing folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/tracing/trace_to_console.h"
6
7 #include <string>
8
9 #include "base/command_line.h"
10 #include "components/tracing/tracing_switches.h"
11
12 namespace tracing {
13
14 namespace {
15 // These categories will cause deadlock when ECHO_TO_CONSOLE. crbug.com/325575.
16 const char kEchoToConsoleCategoryFilter[] = "-ipc,-toplevel";
17 } // namespace
18
19 base::trace_event::TraceConfig GetConfigForTraceToConsole() {
20 const base::CommandLine& command_line =
21 *base::CommandLine::ForCurrentProcess();
22 DCHECK(command_line.HasSwitch(switches::kTraceToConsole));
23 std::string filter = command_line.GetSwitchValueASCII(
24 switches::kTraceToConsole);
25 if (filter.empty()) {
26 filter = kEchoToConsoleCategoryFilter;
27 } else {
28 filter.append(",");
29 filter.append(kEchoToConsoleCategoryFilter);
30 }
31 return base::trace_event::TraceConfig(
32 filter, base::trace_event::ECHO_TO_CONSOLE);
33 }
34
35 } // namespace tracing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698