OLD | NEW |
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 // This header file defines the set of trace_event macros without specifying | 5 // This header file defines the set of trace_event macros without specifying |
6 // how the events actually get collected and stored. If you need to expose trace | 6 // how the events actually get collected and stored. If you need to expose trace |
7 // events to some other universe, you can copy-and-paste this file as well as | 7 // events to some other universe, you can copy-and-paste this file as well as |
8 // trace_event.h, modifying the macros contained there as necessary for the | 8 // trace_event.h, modifying the macros contained there as necessary for the |
9 // target platform. The end result is that multiple libraries can funnel events | 9 // target platform. The end result is that multiple libraries can funnel events |
10 // through to a shared trace event collector. | 10 // through to a shared trace event collector. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // cause some threads to incorrectly call or skip calling AddTraceEvent near | 179 // cause some threads to incorrectly call or skip calling AddTraceEvent near |
180 // the time of the system being enabled or disabled. This is acceptable as | 180 // the time of the system being enabled or disabled. This is acceptable as |
181 // we tolerate some data loss while the system is being enabled/disabled and | 181 // we tolerate some data loss while the system is being enabled/disabled and |
182 // because AddTraceEvent is threadsafe internally and checks the enabled state | 182 // because AddTraceEvent is threadsafe internally and checks the enabled state |
183 // again under lock. | 183 // again under lock. |
184 // | 184 // |
185 // Without the use of these static category pointers and enabled flags all | 185 // Without the use of these static category pointers and enabled flags all |
186 // trace points would carry a significant performance cost of acquiring a lock | 186 // trace points would carry a significant performance cost of acquiring a lock |
187 // and resolving the category. | 187 // and resolving the category. |
188 | 188 |
189 #ifndef BASE_DEBUG_TRACE_EVENT_H_ | 189 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ |
190 #define BASE_DEBUG_TRACE_EVENT_H_ | 190 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ |
191 | 191 |
192 #include <string> | 192 #include <string> |
193 | 193 |
194 #include "base/atomicops.h" | 194 #include "base/atomicops.h" |
195 #include "base/debug/trace_event_impl.h" | |
196 #include "base/debug/trace_event_memory.h" | |
197 #include "base/debug/trace_event_system_stats_monitor.h" | |
198 #include "base/time/time.h" | 195 #include "base/time/time.h" |
| 196 #include "base/trace_event/trace_event_impl.h" |
| 197 #include "base/trace_event/trace_event_memory.h" |
| 198 #include "base/trace_event/trace_event_system_stats_monitor.h" |
199 #include "build/build_config.h" | 199 #include "build/build_config.h" |
200 | 200 |
201 // By default, const char* argument values are assumed to have long-lived scope | 201 // By default, const char* argument values are assumed to have long-lived scope |
202 // and will not be copied. Use this macro to force a const char* to be copied. | 202 // and will not be copied. Use this macro to force a const char* to be copied. |
203 #define TRACE_STR_COPY(str) \ | 203 #define TRACE_STR_COPY(str) \ |
204 trace_event_internal::TraceStringWithCopy(str) | 204 trace_event_internal::TraceStringWithCopy(str) |
205 | 205 |
206 // This will mark the trace event as disabled by default. The user will need | 206 // This will mark the trace event as disabled by default. The user will need |
207 // to explicitly enable the event. | 207 // to explicitly enable the event. |
208 #define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name | 208 #define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 const char* category_group_; | 1579 const char* category_group_; |
1580 const char* name_; | 1580 const char* name_; |
1581 IDType id_; | 1581 IDType id_; |
1582 | 1582 |
1583 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1583 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1584 }; | 1584 }; |
1585 | 1585 |
1586 } // namespace debug | 1586 } // namespace debug |
1587 } // namespace base | 1587 } // namespace base |
1588 | 1588 |
1589 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ | 1589 #endif /* BASE_TRACE_EVENT_TRACE_EVENT_H_ */ |
OLD | NEW |