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 // 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 // snapshotted context object id. | 967 // snapshotted context object id. |
968 #define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context) \ | 968 #define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context) \ |
969 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 969 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
970 TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, \ | 970 TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, \ |
971 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE) | 971 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE) |
972 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ | 972 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ |
973 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 973 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
974 TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, \ | 974 TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, \ |
975 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE) | 975 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE) |
976 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ | 976 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ |
977 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) | 977 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, \ |
| 978 TRACE_ID_DONT_MANGLE(context)) |
978 | 979 |
979 // Macro to efficiently determine if a given category group is enabled. | 980 // Macro to efficiently determine if a given category group is enabled. |
980 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ | 981 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ |
981 do { \ | 982 do { \ |
982 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 983 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
983 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 984 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
984 *ret = true; \ | 985 *ret = true; \ |
985 } else { \ | 986 } else { \ |
986 *ret = false; \ | 987 *ret = false; \ |
987 } \ | 988 } \ |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 | 1074 |
1074 // Enum reflecting the scope of an INSTANT event. Must fit within | 1075 // Enum reflecting the scope of an INSTANT event. Must fit within |
1075 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1076 // TRACE_EVENT_FLAG_SCOPE_MASK. |
1076 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1077 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
1077 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1078 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
1078 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1079 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
1079 | 1080 |
1080 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1081 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
1081 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1082 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
1082 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1083 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
OLD | NEW |