OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/trace_event/trace_event_etw_export_win.h" | 5 #include "base/trace_event/trace_event_etw_export_win.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // static | 230 // static |
231 void TraceEventETWExport::AddEvent( | 231 void TraceEventETWExport::AddEvent( |
232 char phase, | 232 char phase, |
233 const unsigned char* category_group_enabled, | 233 const unsigned char* category_group_enabled, |
234 const char* name, | 234 const char* name, |
235 unsigned long long id, | 235 unsigned long long id, |
236 int num_args, | 236 int num_args, |
237 const char** arg_names, | 237 const char** arg_names, |
238 const unsigned char* arg_types, | 238 const unsigned char* arg_types, |
239 const unsigned long long* arg_values, | 239 const unsigned long long* arg_values, |
240 const scoped_ptr<ConvertableToTraceFormat>* convertable_values) { | 240 const std::unique_ptr<ConvertableToTraceFormat>* convertable_values) { |
241 // We bail early in case exporting is disabled or no consumer is listening. | 241 // We bail early in case exporting is disabled or no consumer is listening. |
242 auto* instance = GetInstance(); | 242 auto* instance = GetInstance(); |
243 if (!instance || !instance->etw_export_enabled_ || !EventEnabledChromeEvent()) | 243 if (!instance || !instance->etw_export_enabled_ || !EventEnabledChromeEvent()) |
244 return; | 244 return; |
245 | 245 |
246 const char* phase_string = nullptr; | 246 const char* phase_string = nullptr; |
247 // Space to store the phase identifier and null-terminator, when needed. | 247 // Space to store the phase identifier and null-terminator, when needed. |
248 char phase_buffer[2]; | 248 char phase_buffer[2]; |
249 switch (phase) { | 249 switch (phase) { |
250 case TRACE_EVENT_PHASE_BEGIN: | 250 case TRACE_EVENT_PHASE_BEGIN: |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 // static | 429 // static |
430 void TraceEventETWExport::UpdateETWKeyword() { | 430 void TraceEventETWExport::UpdateETWKeyword() { |
431 if (!IsETWExportEnabled()) | 431 if (!IsETWExportEnabled()) |
432 return; | 432 return; |
433 auto* instance = GetInstance(); | 433 auto* instance = GetInstance(); |
434 DCHECK(instance); | 434 DCHECK(instance); |
435 instance->UpdateEnabledCategories(); | 435 instance->UpdateEnabledCategories(); |
436 } | 436 } |
437 } // namespace trace_event | 437 } // namespace trace_event |
438 } // namespace base | 438 } // namespace base |
OLD | NEW |