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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 arg1_name, arg1_val) \ | 845 arg1_name, arg1_val) \ |
846 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ | 846 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ |
847 category_group, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ | 847 category_group, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ |
848 arg1_name, arg1_val) | 848 arg1_name, arg1_val) |
849 | 849 |
850 // Records a single FLOW_END event for "name" immediately. If the category | 850 // Records a single FLOW_END event for "name" immediately. If the category |
851 // is not enabled, then this does nothing. | 851 // is not enabled, then this does nothing. |
852 #define TRACE_EVENT_FLOW_END0(category_group, name, id) \ | 852 #define TRACE_EVENT_FLOW_END0(category_group, name, id) \ |
853 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ | 853 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
854 category_group, name, id, TRACE_EVENT_FLAG_NONE) | 854 category_group, name, id, TRACE_EVENT_FLAG_NONE) |
| 855 #define TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0(category_group, name, id) \ |
| 856 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ |
| 857 name, id, \ |
| 858 TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) |
855 #define TRACE_EVENT_FLOW_END1(category_group, name, id, arg1_name, arg1_val) \ | 859 #define TRACE_EVENT_FLOW_END1(category_group, name, id, arg1_name, arg1_val) \ |
856 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ | 860 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
857 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) | 861 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) |
858 #define TRACE_EVENT_FLOW_END2(category_group, name, id, arg1_name, arg1_val, \ | 862 #define TRACE_EVENT_FLOW_END2(category_group, name, id, arg1_name, arg1_val, \ |
859 arg2_name, arg2_val) \ | 863 arg2_name, arg2_val) \ |
860 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ | 864 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
861 category_group, name, id, TRACE_EVENT_FLAG_NONE, \ | 865 category_group, name, id, TRACE_EVENT_FLAG_NONE, \ |
862 arg1_name, arg1_val, arg2_name, arg2_val) | 866 arg1_name, arg1_val, arg2_name, arg2_val) |
863 #define TRACE_EVENT_COPY_FLOW_END0(category_group, name, id) \ | 867 #define TRACE_EVENT_COPY_FLOW_END0(category_group, name, id) \ |
864 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ | 868 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ |
(...skipping 13 matching lines...) Expand all Loading... |
878 // See also TraceTrackableObject. | 882 // See also TraceTrackableObject. |
879 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ | 883 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ |
880 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_CREATE_OBJECT, \ | 884 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_CREATE_OBJECT, \ |
881 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) | 885 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) |
882 | 886 |
883 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, snapshot)
\ | 887 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, snapshot)
\ |
884 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, \ | 888 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, \ |
885 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE,\ | 889 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE,\ |
886 "snapshot", snapshot) | 890 "snapshot", snapshot) |
887 | 891 |
| 892 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP( \ |
| 893 category_group, name, id, timestamp, snapshot) \ |
| 894 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
| 895 TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \ |
| 896 TRACE_ID_DONT_MANGLE(id), \ |
| 897 static_cast<int>(base::PlatformThread::CurrentId()), timestamp, \ |
| 898 TRACE_EVENT_FLAG_NONE, "snapshot", snapshot) |
| 899 |
888 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ | 900 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ |
889 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \ | 901 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \ |
890 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) | 902 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) |
891 | 903 |
892 #define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \ | 904 #define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \ |
893 UNLIKELY(*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \ | 905 UNLIKELY(*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \ |
894 (base::trace_event::TraceLog::ENABLED_FOR_RECORDING | \ | 906 (base::trace_event::TraceLog::ENABLED_FOR_RECORDING | \ |
895 base::trace_event::TraceLog::ENABLED_FOR_EVENT_CALLBACK | \ | 907 base::trace_event::TraceLog::ENABLED_FOR_EVENT_CALLBACK | \ |
896 base::trace_event::TraceLog::ENABLED_FOR_ETW_EXPORT)) | 908 base::trace_event::TraceLog::ENABLED_FOR_ETW_EXPORT)) |
897 | 909 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 // Add a trace event to the platform tracing system. | 959 // Add a trace event to the platform tracing system. |
948 // base::trace_event::TraceEventHandle TRACE_EVENT_API_ADD_TRACE_EVENT( | 960 // base::trace_event::TraceEventHandle TRACE_EVENT_API_ADD_TRACE_EVENT( |
949 // char phase, | 961 // char phase, |
950 // const unsigned char* category_group_enabled, | 962 // const unsigned char* category_group_enabled, |
951 // const char* name, | 963 // const char* name, |
952 // unsigned long long id, | 964 // unsigned long long id, |
953 // int num_args, | 965 // int num_args, |
954 // const char** arg_names, | 966 // const char** arg_names, |
955 // const unsigned char* arg_types, | 967 // const unsigned char* arg_types, |
956 // const unsigned long long* arg_values, | 968 // const unsigned long long* arg_values, |
957 // unsigned char flags) | 969 // unsigned int flags) |
958 #define TRACE_EVENT_API_ADD_TRACE_EVENT \ | 970 #define TRACE_EVENT_API_ADD_TRACE_EVENT \ |
959 base::trace_event::TraceLog::GetInstance()->AddTraceEvent | 971 base::trace_event::TraceLog::GetInstance()->AddTraceEvent |
960 | 972 |
961 // Add a trace event to the platform tracing system. | 973 // Add a trace event to the platform tracing system. |
962 // base::trace_event::TraceEventHandle | 974 // base::trace_event::TraceEventHandle |
963 // TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP( | 975 // TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP( |
964 // char phase, | 976 // char phase, |
965 // const unsigned char* category_group_enabled, | 977 // const unsigned char* category_group_enabled, |
966 // const char* name, | 978 // const char* name, |
967 // unsigned long long id, | 979 // unsigned long long id, |
968 // int thread_id, | 980 // int thread_id, |
969 // const TraceTicks& timestamp, | 981 // const TraceTicks& timestamp, |
970 // int num_args, | 982 // int num_args, |
971 // const char** arg_names, | 983 // const char** arg_names, |
972 // const unsigned char* arg_types, | 984 // const unsigned char* arg_types, |
973 // const unsigned long long* arg_values, | 985 // const unsigned long long* arg_values, |
974 // unsigned char flags) | 986 // unsigned int flags) |
975 #define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP \ | 987 #define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP \ |
976 base::trace_event::TraceLog::GetInstance() \ | 988 base::trace_event::TraceLog::GetInstance() \ |
977 ->AddTraceEventWithThreadIdAndTimestamp | 989 ->AddTraceEventWithThreadIdAndTimestamp |
978 | 990 |
979 // Set the duration field of a COMPLETE trace event. | 991 // Set the duration field of a COMPLETE trace event. |
980 // void TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( | 992 // void TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( |
981 // const unsigned char* category_group_enabled, | 993 // const unsigned char* category_group_enabled, |
982 // const char* name, | 994 // const char* name, |
983 // base::trace_event::TraceEventHandle id) | 995 // base::trace_event::TraceEventHandle id) |
984 #define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION \ | 996 #define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION \ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 TRACE_EVENT_PHASE_COMPLETE, \ | 1072 TRACE_EVENT_PHASE_COMPLETE, \ |
1061 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ | 1073 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ |
1062 trace_event_internal::kNoEventId, TRACE_EVENT_FLAG_NONE, \ | 1074 trace_event_internal::kNoEventId, TRACE_EVENT_FLAG_NONE, \ |
1063 ##__VA_ARGS__); \ | 1075 ##__VA_ARGS__); \ |
1064 INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \ | 1076 INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \ |
1065 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \ | 1077 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \ |
1066 } | 1078 } |
1067 | 1079 |
1068 // Implementation detail: internal macro to create static category and add | 1080 // Implementation detail: internal macro to create static category and add |
1069 // event if the category is enabled. | 1081 // event if the category is enabled. |
1070 #define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category_group, name, id, \ | 1082 #define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category_group, name, id, \ |
1071 flags, ...) \ | 1083 flags, ...) \ |
1072 do { \ | 1084 do { \ |
1073 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 1085 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
1074 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 1086 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
1075 unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ | 1087 unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ |
1076 trace_event_internal::TraceID trace_event_trace_id( \ | 1088 trace_event_internal::TraceID trace_event_trace_id(id, \ |
1077 id, &trace_event_flags); \ | 1089 &trace_event_flags); \ |
1078 trace_event_internal::AddTraceEvent( \ | 1090 trace_event_internal::AddTraceEvent( \ |
1079 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ | 1091 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ |
1080 name, trace_event_trace_id.data(), trace_event_flags, \ | 1092 trace_event_trace_id.data(), trace_event_flags, ##__VA_ARGS__); \ |
1081 ##__VA_ARGS__); \ | 1093 } \ |
1082 } \ | 1094 } while (0) |
1083 } while (0) | |
1084 | 1095 |
1085 // Implementation detail: internal macro to create static category and add | 1096 // Implementation detail: internal macro to create static category and add |
1086 // event if the category is enabled. | 1097 // event if the category is enabled. |
1087 #define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(phase, \ | 1098 #define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
1088 category_group, name, id, thread_id, timestamp, flags, ...) \ | 1099 phase, category_group, name, id, thread_id, timestamp, flags, ...) \ |
1089 do { \ | 1100 do { \ |
1090 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 1101 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
1091 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 1102 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
1092 unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ | 1103 unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ |
1093 trace_event_internal::TraceID trace_event_trace_id( \ | 1104 trace_event_internal::TraceID trace_event_trace_id(id, \ |
1094 id, &trace_event_flags); \ | 1105 &trace_event_flags); \ |
1095 trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ | 1106 trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ |
1096 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ | 1107 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ |
1097 name, trace_event_trace_id.data(), \ | 1108 trace_event_trace_id.data(), thread_id, \ |
1098 thread_id, base::TraceTicks::FromInternalValue(timestamp), \ | 1109 base::TraceTicks::FromInternalValue(timestamp), \ |
1099 trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \ | 1110 trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \ |
1100 ##__VA_ARGS__); \ | 1111 ##__VA_ARGS__); \ |
1101 } \ | 1112 } \ |
1102 } while (0) | 1113 } while (0) |
1103 | 1114 |
1104 // Notes regarding the following definitions: | 1115 // Notes regarding the following definitions: |
1105 // New values can be added and propagated to third party libraries, but existing | 1116 // New values can be added and propagated to third party libraries, but existing |
1106 // definitions must never be changed, because third party libraries may use old | 1117 // definitions must never be changed, because third party libraries may use old |
1107 // definitions. | 1118 // definitions. |
1108 | 1119 |
1109 // Phase indicates the nature of an event entry. E.g. part of a begin/end pair. | 1120 // Phase indicates the nature of an event entry. E.g. part of a begin/end pair. |
1110 #define TRACE_EVENT_PHASE_BEGIN ('B') | 1121 #define TRACE_EVENT_PHASE_BEGIN ('B') |
1111 #define TRACE_EVENT_PHASE_END ('E') | 1122 #define TRACE_EVENT_PHASE_END ('E') |
1112 #define TRACE_EVENT_PHASE_COMPLETE ('X') | 1123 #define TRACE_EVENT_PHASE_COMPLETE ('X') |
(...skipping 10 matching lines...) Expand all Loading... |
1123 #define TRACE_EVENT_PHASE_FLOW_END ('f') | 1134 #define TRACE_EVENT_PHASE_FLOW_END ('f') |
1124 #define TRACE_EVENT_PHASE_METADATA ('M') | 1135 #define TRACE_EVENT_PHASE_METADATA ('M') |
1125 #define TRACE_EVENT_PHASE_COUNTER ('C') | 1136 #define TRACE_EVENT_PHASE_COUNTER ('C') |
1126 #define TRACE_EVENT_PHASE_SAMPLE ('P') | 1137 #define TRACE_EVENT_PHASE_SAMPLE ('P') |
1127 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') | 1138 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') |
1128 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') | 1139 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') |
1129 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') | 1140 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') |
1130 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') | 1141 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') |
1131 | 1142 |
1132 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. | 1143 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. |
1133 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) | 1144 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) |
1134 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) | 1145 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) |
1135 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) | 1146 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) |
1136 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) | 1147 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) |
1137 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 3)) | 1148 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) |
1138 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned char>(1 << 4)) | 1149 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) |
1139 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned char>(1 << 5)) | 1150 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) |
1140 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned char>(1 << 6)) | 1151 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6)) |
| 1152 #define TRACE_EVENT_FLAG_BIND_TO_ENCLOSING (static_cast<unsigned int>(1 << 7)) |
1141 | 1153 |
1142 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \ | 1154 #define TRACE_EVENT_FLAG_SCOPE_MASK \ |
1143 TRACE_EVENT_FLAG_SCOPE_OFFSET | TRACE_EVENT_FLAG_SCOPE_EXTRA)) | 1155 (static_cast<unsigned int>(TRACE_EVENT_FLAG_SCOPE_OFFSET | \ |
| 1156 TRACE_EVENT_FLAG_SCOPE_EXTRA)) |
1144 | 1157 |
1145 // Type values for identifying types in the TraceValue union. | 1158 // Type values for identifying types in the TraceValue union. |
1146 #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1)) | 1159 #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1)) |
1147 #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2)) | 1160 #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2)) |
1148 #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3)) | 1161 #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3)) |
1149 #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4)) | 1162 #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4)) |
1150 #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5)) | 1163 #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5)) |
1151 #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6)) | 1164 #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6)) |
1152 #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7)) | 1165 #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7)) |
1153 #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8)) | 1166 #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8)) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 explicit ForceMangle(int id) | 1226 explicit ForceMangle(int id) |
1214 : data_(static_cast<unsigned long long>(id)) {} | 1227 : data_(static_cast<unsigned long long>(id)) {} |
1215 explicit ForceMangle(short id) | 1228 explicit ForceMangle(short id) |
1216 : data_(static_cast<unsigned long long>(id)) {} | 1229 : data_(static_cast<unsigned long long>(id)) {} |
1217 explicit ForceMangle(signed char id) | 1230 explicit ForceMangle(signed char id) |
1218 : data_(static_cast<unsigned long long>(id)) {} | 1231 : data_(static_cast<unsigned long long>(id)) {} |
1219 unsigned long long data() const { return data_; } | 1232 unsigned long long data() const { return data_; } |
1220 private: | 1233 private: |
1221 unsigned long long data_; | 1234 unsigned long long data_; |
1222 }; | 1235 }; |
1223 TraceID(const void* id, unsigned char* flags) | 1236 TraceID(const void* id, unsigned int* flags) |
1224 : data_(static_cast<unsigned long long>( | 1237 : data_( |
1225 reinterpret_cast<uintptr_t>(id))) { | 1238 static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(id))) { |
1226 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 1239 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
1227 } | 1240 } |
1228 TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) { | 1241 TraceID(ForceMangle id, unsigned int* flags) : data_(id.data()) { |
1229 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 1242 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
1230 } | 1243 } |
1231 TraceID(DontMangle id, unsigned char* flags) : data_(id.data()) { | 1244 TraceID(DontMangle id, unsigned int* flags) : data_(id.data()) {} |
| 1245 TraceID(unsigned long long id, unsigned int* flags) : data_(id) { |
| 1246 (void)flags; |
1232 } | 1247 } |
1233 TraceID(unsigned long long id, unsigned char* flags) | 1248 TraceID(unsigned long id, unsigned int* flags) : data_(id) { (void)flags; } |
1234 : data_(id) { (void)flags; } | 1249 TraceID(unsigned int id, unsigned int* flags) : data_(id) { (void)flags; } |
1235 TraceID(unsigned long id, unsigned char* flags) | 1250 TraceID(unsigned short id, unsigned int* flags) : data_(id) { (void)flags; } |
1236 : data_(id) { (void)flags; } | 1251 TraceID(unsigned char id, unsigned int* flags) : data_(id) { (void)flags; } |
1237 TraceID(unsigned int id, unsigned char* flags) | 1252 TraceID(long long id, unsigned int* flags) |
1238 : data_(id) { (void)flags; } | 1253 : data_(static_cast<unsigned long long>(id)) { |
1239 TraceID(unsigned short id, unsigned char* flags) | 1254 (void)flags; |
1240 : data_(id) { (void)flags; } | 1255 } |
1241 TraceID(unsigned char id, unsigned char* flags) | 1256 TraceID(long id, unsigned int* flags) |
1242 : data_(id) { (void)flags; } | 1257 : data_(static_cast<unsigned long long>(id)) { |
1243 TraceID(long long id, unsigned char* flags) | 1258 (void)flags; |
1244 : data_(static_cast<unsigned long long>(id)) { (void)flags; } | 1259 } |
1245 TraceID(long id, unsigned char* flags) | 1260 TraceID(int id, unsigned int* flags) |
1246 : data_(static_cast<unsigned long long>(id)) { (void)flags; } | 1261 : data_(static_cast<unsigned long long>(id)) { |
1247 TraceID(int id, unsigned char* flags) | 1262 (void)flags; |
1248 : data_(static_cast<unsigned long long>(id)) { (void)flags; } | 1263 } |
1249 TraceID(short id, unsigned char* flags) | 1264 TraceID(short id, unsigned int* flags) |
1250 : data_(static_cast<unsigned long long>(id)) { (void)flags; } | 1265 : data_(static_cast<unsigned long long>(id)) { |
1251 TraceID(signed char id, unsigned char* flags) | 1266 (void)flags; |
1252 : data_(static_cast<unsigned long long>(id)) { (void)flags; } | 1267 } |
| 1268 TraceID(signed char id, unsigned int* flags) |
| 1269 : data_(static_cast<unsigned long long>(id)) { |
| 1270 (void)flags; |
| 1271 } |
1253 | 1272 |
1254 unsigned long long data() const { return data_; } | 1273 unsigned long long data() const { return data_; } |
1255 | 1274 |
1256 private: | 1275 private: |
1257 unsigned long long data_; | 1276 unsigned long long data_; |
1258 }; | 1277 }; |
1259 | 1278 |
1260 // Simple union to store various types as unsigned long long. | 1279 // Simple union to store various types as unsigned long long. |
1261 union TraceValueUnion { | 1280 union TraceValueUnion { |
1262 bool as_bool; | 1281 bool as_bool; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 // the arg_values must live throughout these procedures. | 1392 // the arg_values must live throughout these procedures. |
1374 | 1393 |
1375 static inline base::trace_event::TraceEventHandle | 1394 static inline base::trace_event::TraceEventHandle |
1376 AddTraceEventWithThreadIdAndTimestamp( | 1395 AddTraceEventWithThreadIdAndTimestamp( |
1377 char phase, | 1396 char phase, |
1378 const unsigned char* category_group_enabled, | 1397 const unsigned char* category_group_enabled, |
1379 const char* name, | 1398 const char* name, |
1380 unsigned long long id, | 1399 unsigned long long id, |
1381 int thread_id, | 1400 int thread_id, |
1382 const base::TraceTicks& timestamp, | 1401 const base::TraceTicks& timestamp, |
1383 unsigned char flags, | 1402 unsigned int flags, |
1384 const char* arg1_name, | 1403 const char* arg1_name, |
1385 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& | 1404 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& |
1386 arg1_val) { | 1405 arg1_val) { |
1387 const int num_args = 1; | 1406 const int num_args = 1; |
1388 unsigned char arg_types[1] = { TRACE_VALUE_TYPE_CONVERTABLE }; | 1407 unsigned char arg_types[1] = { TRACE_VALUE_TYPE_CONVERTABLE }; |
1389 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 1408 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
1390 phase, category_group_enabled, name, id, thread_id, timestamp, | 1409 phase, category_group_enabled, name, id, thread_id, timestamp, |
1391 num_args, &arg1_name, arg_types, NULL, &arg1_val, flags); | 1410 num_args, &arg1_name, arg_types, NULL, &arg1_val, flags); |
1392 } | 1411 } |
1393 | 1412 |
1394 template<class ARG1_TYPE> | 1413 template <class ARG1_TYPE> |
1395 static inline base::trace_event::TraceEventHandle | 1414 static inline base::trace_event::TraceEventHandle |
1396 AddTraceEventWithThreadIdAndTimestamp( | 1415 AddTraceEventWithThreadIdAndTimestamp( |
1397 char phase, | 1416 char phase, |
1398 const unsigned char* category_group_enabled, | 1417 const unsigned char* category_group_enabled, |
1399 const char* name, | 1418 const char* name, |
1400 unsigned long long id, | 1419 unsigned long long id, |
1401 int thread_id, | 1420 int thread_id, |
1402 const base::TraceTicks& timestamp, | 1421 const base::TraceTicks& timestamp, |
1403 unsigned char flags, | 1422 unsigned int flags, |
1404 const char* arg1_name, | 1423 const char* arg1_name, |
1405 const ARG1_TYPE& arg1_val, | 1424 const ARG1_TYPE& arg1_val, |
1406 const char* arg2_name, | 1425 const char* arg2_name, |
1407 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& | 1426 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& |
1408 arg2_val) { | 1427 arg2_val) { |
1409 const int num_args = 2; | 1428 const int num_args = 2; |
1410 const char* arg_names[2] = { arg1_name, arg2_name }; | 1429 const char* arg_names[2] = { arg1_name, arg2_name }; |
1411 | 1430 |
1412 unsigned char arg_types[2]; | 1431 unsigned char arg_types[2]; |
1413 unsigned long long arg_values[2]; | 1432 unsigned long long arg_values[2]; |
1414 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); | 1433 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); |
1415 arg_types[1] = TRACE_VALUE_TYPE_CONVERTABLE; | 1434 arg_types[1] = TRACE_VALUE_TYPE_CONVERTABLE; |
1416 | 1435 |
1417 scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 1436 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
1418 convertable_values[2]; | 1437 convertable_values[2]; |
1419 convertable_values[1] = arg2_val; | 1438 convertable_values[1] = arg2_val; |
1420 | 1439 |
1421 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 1440 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
1422 phase, category_group_enabled, name, id, thread_id, timestamp, | 1441 phase, category_group_enabled, name, id, thread_id, timestamp, |
1423 num_args, arg_names, arg_types, arg_values, convertable_values, flags); | 1442 num_args, arg_names, arg_types, arg_values, convertable_values, flags); |
1424 } | 1443 } |
1425 | 1444 |
1426 template<class ARG2_TYPE> | 1445 template <class ARG2_TYPE> |
1427 static inline base::trace_event::TraceEventHandle | 1446 static inline base::trace_event::TraceEventHandle |
1428 AddTraceEventWithThreadIdAndTimestamp( | 1447 AddTraceEventWithThreadIdAndTimestamp( |
1429 char phase, | 1448 char phase, |
1430 const unsigned char* category_group_enabled, | 1449 const unsigned char* category_group_enabled, |
1431 const char* name, | 1450 const char* name, |
1432 unsigned long long id, | 1451 unsigned long long id, |
1433 int thread_id, | 1452 int thread_id, |
1434 const base::TraceTicks& timestamp, | 1453 const base::TraceTicks& timestamp, |
1435 unsigned char flags, | 1454 unsigned int flags, |
1436 const char* arg1_name, | 1455 const char* arg1_name, |
1437 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& arg1_val, | 1456 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& arg1_val, |
1438 const char* arg2_name, | 1457 const char* arg2_name, |
1439 const ARG2_TYPE& arg2_val) { | 1458 const ARG2_TYPE& arg2_val) { |
1440 const int num_args = 2; | 1459 const int num_args = 2; |
1441 const char* arg_names[2] = { arg1_name, arg2_name }; | 1460 const char* arg_names[2] = { arg1_name, arg2_name }; |
1442 | 1461 |
1443 unsigned char arg_types[2]; | 1462 unsigned char arg_types[2]; |
1444 unsigned long long arg_values[2]; | 1463 unsigned long long arg_values[2]; |
1445 arg_types[0] = TRACE_VALUE_TYPE_CONVERTABLE; | 1464 arg_types[0] = TRACE_VALUE_TYPE_CONVERTABLE; |
(...skipping 10 matching lines...) Expand all Loading... |
1456 } | 1475 } |
1457 | 1476 |
1458 static inline base::trace_event::TraceEventHandle | 1477 static inline base::trace_event::TraceEventHandle |
1459 AddTraceEventWithThreadIdAndTimestamp( | 1478 AddTraceEventWithThreadIdAndTimestamp( |
1460 char phase, | 1479 char phase, |
1461 const unsigned char* category_group_enabled, | 1480 const unsigned char* category_group_enabled, |
1462 const char* name, | 1481 const char* name, |
1463 unsigned long long id, | 1482 unsigned long long id, |
1464 int thread_id, | 1483 int thread_id, |
1465 const base::TraceTicks& timestamp, | 1484 const base::TraceTicks& timestamp, |
1466 unsigned char flags, | 1485 unsigned int flags, |
1467 const char* arg1_name, | 1486 const char* arg1_name, |
1468 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& arg1_val, | 1487 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& arg1_val, |
1469 const char* arg2_name, | 1488 const char* arg2_name, |
1470 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& | 1489 const scoped_refptr<base::trace_event::ConvertableToTraceFormat>& |
1471 arg2_val) { | 1490 arg2_val) { |
1472 const int num_args = 2; | 1491 const int num_args = 2; |
1473 const char* arg_names[2] = { arg1_name, arg2_name }; | 1492 const char* arg_names[2] = { arg1_name, arg2_name }; |
1474 unsigned char arg_types[2] = | 1493 unsigned char arg_types[2] = |
1475 { TRACE_VALUE_TYPE_CONVERTABLE, TRACE_VALUE_TYPE_CONVERTABLE }; | 1494 { TRACE_VALUE_TYPE_CONVERTABLE, TRACE_VALUE_TYPE_CONVERTABLE }; |
1476 scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 1495 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
1477 convertable_values[2] = {arg1_val, arg2_val}; | 1496 convertable_values[2] = {arg1_val, arg2_val}; |
1478 | 1497 |
1479 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 1498 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
1480 phase, category_group_enabled, name, id, thread_id, timestamp, | 1499 phase, category_group_enabled, name, id, thread_id, timestamp, |
1481 num_args, arg_names, arg_types, NULL, convertable_values, flags); | 1500 num_args, arg_names, arg_types, NULL, convertable_values, flags); |
1482 } | 1501 } |
1483 | 1502 |
1484 static inline base::trace_event::TraceEventHandle | 1503 static inline base::trace_event::TraceEventHandle |
1485 AddTraceEventWithThreadIdAndTimestamp( | 1504 AddTraceEventWithThreadIdAndTimestamp( |
1486 char phase, | 1505 char phase, |
1487 const unsigned char* category_group_enabled, | 1506 const unsigned char* category_group_enabled, |
1488 const char* name, | 1507 const char* name, |
1489 unsigned long long id, | 1508 unsigned long long id, |
1490 int thread_id, | 1509 int thread_id, |
1491 const base::TraceTicks& timestamp, | 1510 const base::TraceTicks& timestamp, |
1492 unsigned char flags) { | 1511 unsigned int flags) { |
1493 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 1512 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
1494 phase, category_group_enabled, name, id, thread_id, timestamp, | 1513 phase, category_group_enabled, name, id, thread_id, timestamp, |
1495 kZeroNumArgs, NULL, NULL, NULL, NULL, flags); | 1514 kZeroNumArgs, NULL, NULL, NULL, NULL, flags); |
1496 } | 1515 } |
1497 | 1516 |
1498 static inline base::trace_event::TraceEventHandle AddTraceEvent( | 1517 static inline base::trace_event::TraceEventHandle AddTraceEvent( |
1499 char phase, | 1518 char phase, |
1500 const unsigned char* category_group_enabled, | 1519 const unsigned char* category_group_enabled, |
1501 const char* name, | 1520 const char* name, |
1502 unsigned long long id, | 1521 unsigned long long id, |
1503 unsigned char flags) { | 1522 unsigned int flags) { |
1504 const int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); | 1523 const int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); |
1505 const base::TraceTicks now = base::TraceTicks::Now(); | 1524 const base::TraceTicks now = base::TraceTicks::Now(); |
1506 return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, | 1525 return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, |
1507 name, id, thread_id, now, flags); | 1526 name, id, thread_id, now, flags); |
1508 } | 1527 } |
1509 | 1528 |
1510 template<class ARG1_TYPE> | 1529 template <class ARG1_TYPE> |
1511 static inline base::trace_event::TraceEventHandle | 1530 static inline base::trace_event::TraceEventHandle |
1512 AddTraceEventWithThreadIdAndTimestamp( | 1531 AddTraceEventWithThreadIdAndTimestamp( |
1513 char phase, | 1532 char phase, |
1514 const unsigned char* category_group_enabled, | 1533 const unsigned char* category_group_enabled, |
1515 const char* name, | 1534 const char* name, |
1516 unsigned long long id, | 1535 unsigned long long id, |
1517 int thread_id, | 1536 int thread_id, |
1518 const base::TraceTicks& timestamp, | 1537 const base::TraceTicks& timestamp, |
1519 unsigned char flags, | 1538 unsigned int flags, |
1520 const char* arg1_name, | 1539 const char* arg1_name, |
1521 const ARG1_TYPE& arg1_val) { | 1540 const ARG1_TYPE& arg1_val) { |
1522 const int num_args = 1; | 1541 const int num_args = 1; |
1523 unsigned char arg_types[1]; | 1542 unsigned char arg_types[1]; |
1524 unsigned long long arg_values[1]; | 1543 unsigned long long arg_values[1]; |
1525 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); | 1544 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); |
1526 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 1545 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
1527 phase, category_group_enabled, name, id, thread_id, timestamp, | 1546 phase, category_group_enabled, name, id, thread_id, timestamp, |
1528 num_args, &arg1_name, arg_types, arg_values, NULL, flags); | 1547 num_args, &arg1_name, arg_types, arg_values, NULL, flags); |
1529 } | 1548 } |
1530 | 1549 |
1531 template<class ARG1_TYPE> | 1550 template <class ARG1_TYPE> |
1532 static inline base::trace_event::TraceEventHandle AddTraceEvent( | 1551 static inline base::trace_event::TraceEventHandle AddTraceEvent( |
1533 char phase, | 1552 char phase, |
1534 const unsigned char* category_group_enabled, | 1553 const unsigned char* category_group_enabled, |
1535 const char* name, | 1554 const char* name, |
1536 unsigned long long id, | 1555 unsigned long long id, |
1537 unsigned char flags, | 1556 unsigned int flags, |
1538 const char* arg1_name, | 1557 const char* arg1_name, |
1539 const ARG1_TYPE& arg1_val) { | 1558 const ARG1_TYPE& arg1_val) { |
1540 int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); | 1559 int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); |
1541 base::TraceTicks now = base::TraceTicks::Now(); | 1560 base::TraceTicks now = base::TraceTicks::Now(); |
1542 return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, | 1561 return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, |
1543 name, id, thread_id, now, flags, | 1562 name, id, thread_id, now, flags, |
1544 arg1_name, arg1_val); | 1563 arg1_name, arg1_val); |
1545 } | 1564 } |
1546 | 1565 |
1547 template<class ARG1_TYPE, class ARG2_TYPE> | 1566 template <class ARG1_TYPE, class ARG2_TYPE> |
1548 static inline base::trace_event::TraceEventHandle | 1567 static inline base::trace_event::TraceEventHandle |
1549 AddTraceEventWithThreadIdAndTimestamp( | 1568 AddTraceEventWithThreadIdAndTimestamp( |
1550 char phase, | 1569 char phase, |
1551 const unsigned char* category_group_enabled, | 1570 const unsigned char* category_group_enabled, |
1552 const char* name, | 1571 const char* name, |
1553 unsigned long long id, | 1572 unsigned long long id, |
1554 int thread_id, | 1573 int thread_id, |
1555 const base::TraceTicks& timestamp, | 1574 const base::TraceTicks& timestamp, |
1556 unsigned char flags, | 1575 unsigned int flags, |
1557 const char* arg1_name, | 1576 const char* arg1_name, |
1558 const ARG1_TYPE& arg1_val, | 1577 const ARG1_TYPE& arg1_val, |
1559 const char* arg2_name, | 1578 const char* arg2_name, |
1560 const ARG2_TYPE& arg2_val) { | 1579 const ARG2_TYPE& arg2_val) { |
1561 const int num_args = 2; | 1580 const int num_args = 2; |
1562 const char* arg_names[2] = { arg1_name, arg2_name }; | 1581 const char* arg_names[2] = { arg1_name, arg2_name }; |
1563 unsigned char arg_types[2]; | 1582 unsigned char arg_types[2]; |
1564 unsigned long long arg_values[2]; | 1583 unsigned long long arg_values[2]; |
1565 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); | 1584 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); |
1566 SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]); | 1585 SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]); |
1567 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 1586 return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
1568 phase, category_group_enabled, name, id, thread_id, timestamp, | 1587 phase, category_group_enabled, name, id, thread_id, timestamp, |
1569 num_args, arg_names, arg_types, arg_values, NULL, flags); | 1588 num_args, arg_names, arg_types, arg_values, NULL, flags); |
1570 } | 1589 } |
1571 | 1590 |
1572 template<class ARG1_TYPE, class ARG2_TYPE> | 1591 template <class ARG1_TYPE, class ARG2_TYPE> |
1573 static inline base::trace_event::TraceEventHandle AddTraceEvent( | 1592 static inline base::trace_event::TraceEventHandle AddTraceEvent( |
1574 char phase, | 1593 char phase, |
1575 const unsigned char* category_group_enabled, | 1594 const unsigned char* category_group_enabled, |
1576 const char* name, | 1595 const char* name, |
1577 unsigned long long id, | 1596 unsigned long long id, |
1578 unsigned char flags, | 1597 unsigned int flags, |
1579 const char* arg1_name, | 1598 const char* arg1_name, |
1580 const ARG1_TYPE& arg1_val, | 1599 const ARG1_TYPE& arg1_val, |
1581 const char* arg2_name, | 1600 const char* arg2_name, |
1582 const ARG2_TYPE& arg2_val) { | 1601 const ARG2_TYPE& arg2_val) { |
1583 int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); | 1602 int thread_id = static_cast<int>(base::PlatformThread::CurrentId()); |
1584 base::TraceTicks now = base::TraceTicks::Now(); | 1603 base::TraceTicks now = base::TraceTicks::Now(); |
1585 return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, | 1604 return AddTraceEventWithThreadIdAndTimestamp(phase, category_group_enabled, |
1586 name, id, thread_id, now, flags, | 1605 name, id, thread_id, now, flags, |
1587 arg1_name, arg1_val, | 1606 arg1_name, arg1_val, |
1588 arg2_name, arg2_val); | 1607 arg2_name, arg2_val); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 const char* name_; | 1723 const char* name_; |
1705 IDType id_; | 1724 IDType id_; |
1706 | 1725 |
1707 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1726 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1708 }; | 1727 }; |
1709 | 1728 |
1710 } // namespace trace_event | 1729 } // namespace trace_event |
1711 } // namespace base | 1730 } // namespace base |
1712 | 1731 |
1713 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 1732 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
OLD | NEW |