OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Trace events are for tracking application performance. | 5 // Trace events are for tracking application performance. |
6 // | 6 // |
7 // Events are issued against categories. Whereas LOG's | 7 // Events are issued against categories. Whereas LOG's |
8 // categories are statically defined, TRACE categories are created | 8 // categories are statically defined, TRACE categories are created |
9 // implicitly with a string. For example: | 9 // implicitly with a string. For example: |
10 // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") | 10 // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 #pragma once | 96 #pragma once |
97 | 97 |
98 #include "build/build_config.h" | 98 #include "build/build_config.h" |
99 | 99 |
100 #include <string> | 100 #include <string> |
101 #include <vector> | 101 #include <vector> |
102 | 102 |
103 #include "base/callback.h" | 103 #include "base/callback.h" |
104 #include "base/hash_tables.h" | 104 #include "base/hash_tables.h" |
105 #include "base/memory/ref_counted_memory.h" | 105 #include "base/memory/ref_counted_memory.h" |
106 #include "base/memory/singleton.h" | |
107 #include "base/string_util.h" | 106 #include "base/string_util.h" |
108 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 107 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
109 #include "base/timer.h" | 108 #include "base/timer.h" |
110 | 109 |
111 // By default, const char* argument values are assumed to have long-lived scope | 110 // By default, const char* argument values are assumed to have long-lived scope |
112 // and will not be copied. Use this macro to force a const char* to be copied. | 111 // and will not be copied. Use this macro to force a const char* to be copied. |
113 #define TRACE_STR_COPY(str) base::debug::TraceValue::StringWithCopy(str) | 112 #define TRACE_STR_COPY(str) base::debug::TraceValue::StringWithCopy(str) |
114 | 113 |
115 // Older style trace macros with explicit id and extra data | 114 // Older style trace macros with explicit id and extra data |
116 // Only these macros result in publishing data to ETW as currently implemented. | 115 // Only these macros result in publishing data to ETW as currently implemented. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 base::debug::TraceLog::GetInstance()->AddTraceEvent( \ | 317 base::debug::TraceLog::GetInstance()->AddTraceEvent( \ |
319 base::debug::TRACE_EVENT_PHASE_BEGIN, \ | 318 base::debug::TRACE_EVENT_PHASE_BEGIN, \ |
320 INTERNAL_TRACE_EVENT_UID(catstatic), \ | 319 INTERNAL_TRACE_EVENT_UID(catstatic), \ |
321 name, arg1_name, arg1_val, arg2_name, arg2_val, -1, 0, \ | 320 name, arg1_name, arg1_val, arg2_name, arg2_val, -1, 0, \ |
322 base::debug::TraceLog::EVENT_FLAG_NONE); \ | 321 base::debug::TraceLog::EVENT_FLAG_NONE); \ |
323 INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \ | 322 INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \ |
324 INTERNAL_TRACE_EVENT_UID(catstatic), name, \ | 323 INTERNAL_TRACE_EVENT_UID(catstatic), name, \ |
325 INTERNAL_TRACE_EVENT_UID(begin_event_id), threshold); \ | 324 INTERNAL_TRACE_EVENT_UID(begin_event_id), threshold); \ |
326 } | 325 } |
327 | 326 |
| 327 template <typename Type> |
| 328 struct StaticMemorySingletonTraits; |
| 329 |
328 namespace base { | 330 namespace base { |
329 | 331 |
330 class RefCountedString; | 332 class RefCountedString; |
331 | 333 |
332 namespace debug { | 334 namespace debug { |
333 | 335 |
334 // Categories allow enabling/disabling of streams of trace events | 336 // Categories allow enabling/disabling of streams of trace events |
335 struct TraceCategory { | 337 struct TraceCategory { |
336 const char* name; | 338 const char* name; |
337 volatile bool enabled; | 339 volatile bool enabled; |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 Data* p_data_; | 754 Data* p_data_; |
753 Data data_; | 755 Data data_; |
754 }; | 756 }; |
755 | 757 |
756 } // namespace internal | 758 } // namespace internal |
757 | 759 |
758 } // namespace debug | 760 } // namespace debug |
759 } // namespace base | 761 } // namespace base |
760 | 762 |
761 #endif // BASE_DEBUG_TRACE_EVENT_H_ | 763 #endif // BASE_DEBUG_TRACE_EVENT_H_ |
OLD | NEW |