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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, context, \ | 993 TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, context, \ |
994 TRACE_EVENT_FLAG_NONE) | 994 TRACE_EVENT_FLAG_NONE) |
995 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ | 995 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ |
996 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 996 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
997 TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, context, \ | 997 TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, context, \ |
998 TRACE_EVENT_FLAG_NONE) | 998 TRACE_EVENT_FLAG_NONE) |
999 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ | 999 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ |
1000 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) | 1000 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) |
1001 | 1001 |
1002 // Macro to specify that two trace IDs are identical. For example, | 1002 // Macro to specify that two trace IDs are identical. For example, |
1003 // TRACE_BIND_IDS( | 1003 // TRACE_LINK_IDS( |
1004 // "category", "name", | 1004 // "category", "name", |
1005 // TRACE_ID_WITH_SCOPE("net::URLRequest", 0x1000), | 1005 // TRACE_ID_WITH_SCOPE("net::URLRequest", 0x1000), |
1006 // TRACE_ID_WITH_SCOPE("blink::ResourceFetcher::FetchRequest", 0x2000)) | 1006 // TRACE_ID_WITH_SCOPE("blink::ResourceFetcher::FetchRequest", 0x2000)) |
1007 // tells the trace consumer that events with ID ("net::URLRequest", 0x1000) from | 1007 // tells the trace consumer that events with ID ("net::URLRequest", 0x1000) from |
1008 // the current process have the same ID as events with ID | 1008 // the current process have the same ID as events with ID |
1009 // ("blink::ResourceFetcher::FetchRequest", 0x2000). | 1009 // ("blink::ResourceFetcher::FetchRequest", 0x2000). |
1010 #define TRACE_BIND_IDS(category_group, name, id, bind_id) \ | 1010 #define TRACE_LINK_IDS(category_group, name, id, linked_id) \ |
1011 INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id); | 1011 INTERNAL_TRACE_EVENT_ADD_LINK_IDS(category_group, name, id, linked_id); |
1012 | 1012 |
1013 // Macro to efficiently determine if a given category group is enabled. | 1013 // Macro to efficiently determine if a given category group is enabled. |
1014 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ | 1014 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ |
1015 do { \ | 1015 do { \ |
1016 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 1016 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
1017 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 1017 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
1018 *ret = true; \ | 1018 *ret = true; \ |
1019 } else { \ | 1019 } else { \ |
1020 *ret = false; \ | 1020 *ret = false; \ |
1021 } \ | 1021 } \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 #define TRACE_EVENT_PHASE_COUNTER ('C') | 1068 #define TRACE_EVENT_PHASE_COUNTER ('C') |
1069 #define TRACE_EVENT_PHASE_SAMPLE ('P') | 1069 #define TRACE_EVENT_PHASE_SAMPLE ('P') |
1070 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') | 1070 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') |
1071 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') | 1071 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') |
1072 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') | 1072 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') |
1073 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') | 1073 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') |
1074 #define TRACE_EVENT_PHASE_MARK ('R') | 1074 #define TRACE_EVENT_PHASE_MARK ('R') |
1075 #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c') | 1075 #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c') |
1076 #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(') | 1076 #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(') |
1077 #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')') | 1077 #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')') |
1078 #define TRACE_EVENT_PHASE_BIND_IDS ('=') | 1078 #define TRACE_EVENT_PHASE_LINK_IDS ('=') |
1079 | 1079 |
1080 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. | 1080 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. |
1081 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) | 1081 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) |
1082 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) | 1082 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) |
1083 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) | 1083 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) |
1084 // TODO(crbug.com/639003): Free this bit after ID mangling is deprecated. | 1084 // TODO(crbug.com/639003): Free this bit after ID mangling is deprecated. |
1085 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) | 1085 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) |
1086 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) | 1086 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) |
1087 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) | 1087 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) |
1088 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) | 1088 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) |
(...skipping 22 matching lines...) Expand all Loading... |
1111 | 1111 |
1112 // Enum reflecting the scope of an INSTANT event. Must fit within | 1112 // Enum reflecting the scope of an INSTANT event. Must fit within |
1113 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1113 // TRACE_EVENT_FLAG_SCOPE_MASK. |
1114 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1114 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
1115 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1115 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
1116 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1116 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
1117 | 1117 |
1118 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1118 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
1119 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1119 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
1120 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1120 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
OLD | NEW |