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

Side by Side Diff: components/tracing/common/trace_startup.cc

Issue 2466873002: Enable FILTERING_MODE for tracing if event filters were given in config (Closed)
Patch Set: Rebase and add TODO. Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/tracing/common/trace_startup.h" 5 #include "components/tracing/common/trace_startup.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/trace_event/memory_dump_manager.h" 9 #include "base/trace_event/memory_dump_manager.h"
10 #include "base/trace_event/trace_log.h" 10 #include "base/trace_event/trace_log.h"
(...skipping 20 matching lines...) Expand all
31 } else if (command_line.HasSwitch(switches::kTraceToConsole)) { 31 } else if (command_line.HasSwitch(switches::kTraceToConsole)) {
32 base::trace_event::TraceConfig trace_config = 32 base::trace_event::TraceConfig trace_config =
33 tracing::GetConfigForTraceToConsole(); 33 tracing::GetConfigForTraceToConsole();
34 LOG(ERROR) << "Start " << switches::kTraceToConsole 34 LOG(ERROR) << "Start " << switches::kTraceToConsole
35 << " with CategoryFilter '" 35 << " with CategoryFilter '"
36 << trace_config.ToCategoryFilterString() << "'."; 36 << trace_config.ToCategoryFilterString() << "'.";
37 base::trace_event::TraceLog::GetInstance()->SetEnabled( 37 base::trace_event::TraceLog::GetInstance()->SetEnabled(
38 trace_config, base::trace_event::TraceLog::RECORDING_MODE); 38 trace_config, base::trace_event::TraceLog::RECORDING_MODE);
39 } else if (can_access_file_system && 39 } else if (can_access_file_system &&
40 tracing::TraceConfigFile::GetInstance()->IsEnabled()) { 40 tracing::TraceConfigFile::GetInstance()->IsEnabled()) {
41 const base::trace_event::TraceConfig& trace_config =
42 tracing::TraceConfigFile::GetInstance()->GetTraceConfig();
43 uint8_t modes = base::trace_event::TraceLog::RECORDING_MODE;
44 if (!trace_config.event_filters().empty())
45 modes |= base::trace_event::TraceLog::FILTERING_MODE;
41 // This checks kTraceConfigFile switch. 46 // This checks kTraceConfigFile switch.
42 base::trace_event::TraceLog::GetInstance()->SetEnabled( 47 base::trace_event::TraceLog::GetInstance()->SetEnabled(
43 tracing::TraceConfigFile::GetInstance()->GetTraceConfig(), 48 tracing::TraceConfigFile::GetInstance()->GetTraceConfig(), modes);
44 base::trace_event::TraceLog::RECORDING_MODE);
45 } 49 }
46 } 50 }
47 51
48 } // namespace tracing 52 } // namespace tracing
OLDNEW
« no previous file with comments | « components/tracing/child/child_trace_message_filter.cc ('k') | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698