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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 do { \ | 1001 do { \ |
1002 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 1002 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
1003 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 1003 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
1004 unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ | 1004 unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ |
1005 trace_event_internal::TraceID trace_event_trace_id( \ | 1005 trace_event_internal::TraceID trace_event_trace_id( \ |
1006 id, &trace_event_flags); \ | 1006 id, &trace_event_flags); \ |
1007 trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ | 1007 trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ |
1008 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ | 1008 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ |
1009 name, trace_event_trace_id.data(), \ | 1009 name, trace_event_trace_id.data(), \ |
1010 thread_id, base::TimeTicks::FromInternalValue(timestamp), \ | 1010 thread_id, base::TimeTicks::FromInternalValue(timestamp), \ |
1011 trace_event_flags, ##__VA_ARGS__); \ | 1011 trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \ |
| 1012 ##__VA_ARGS__); \ |
1012 } \ | 1013 } \ |
1013 } while (0) | 1014 } while (0) |
1014 | 1015 |
1015 // Notes regarding the following definitions: | 1016 // Notes regarding the following definitions: |
1016 // New values can be added and propagated to third party libraries, but existing | 1017 // New values can be added and propagated to third party libraries, but existing |
1017 // definitions must never be changed, because third party libraries may use old | 1018 // definitions must never be changed, because third party libraries may use old |
1018 // definitions. | 1019 // definitions. |
1019 | 1020 |
1020 // Phase indicates the nature of an event entry. E.g. part of a begin/end pair. | 1021 // Phase indicates the nature of an event entry. E.g. part of a begin/end pair. |
1021 #define TRACE_EVENT_PHASE_BEGIN ('B') | 1022 #define TRACE_EVENT_PHASE_BEGIN ('B') |
(...skipping 16 matching lines...) Expand all Loading... |
1038 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') | 1039 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') |
1039 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') | 1040 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') |
1040 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') | 1041 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') |
1041 | 1042 |
1042 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. | 1043 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. |
1043 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) | 1044 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) |
1044 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) | 1045 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) |
1045 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) | 1046 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) |
1046 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) | 1047 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) |
1047 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 3)) | 1048 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 3)) |
| 1049 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned char>(1 << 4)) |
| 1050 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned char>(1 << 5)) |
1048 | 1051 |
1049 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \ | 1052 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \ |
1050 TRACE_EVENT_FLAG_SCOPE_OFFSET | (TRACE_EVENT_FLAG_SCOPE_OFFSET << 1))) | 1053 TRACE_EVENT_FLAG_SCOPE_OFFSET | TRACE_EVENT_FLAG_SCOPE_EXTRA)) |
1051 | 1054 |
1052 // Type values for identifying types in the TraceValue union. | 1055 // Type values for identifying types in the TraceValue union. |
1053 #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1)) | 1056 #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1)) |
1054 #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2)) | 1057 #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2)) |
1055 #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3)) | 1058 #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3)) |
1056 #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4)) | 1059 #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4)) |
1057 #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5)) | 1060 #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5)) |
1058 #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6)) | 1061 #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6)) |
1059 #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7)) | 1062 #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7)) |
1060 #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8)) | 1063 #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8)) |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 const char* name_; | 1600 const char* name_; |
1598 IDType id_; | 1601 IDType id_; |
1599 | 1602 |
1600 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1603 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1601 }; | 1604 }; |
1602 | 1605 |
1603 } // namespace trace_event | 1606 } // namespace trace_event |
1604 } // namespace base | 1607 } // namespace base |
1605 | 1608 |
1606 #endif /* BASE_TRACE_EVENT_TRACE_EVENT_H_ */ | 1609 #endif /* BASE_TRACE_EVENT_TRACE_EVENT_H_ */ |
OLD | NEW |