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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 arg1_val) \ | 919 arg1_val) \ |
920 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ | 920 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ |
921 name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ | 921 name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ |
922 arg1_val) | 922 arg1_val) |
923 #define TRACE_EVENT_COPY_FLOW_END2(category_group, name, id, arg1_name, \ | 923 #define TRACE_EVENT_COPY_FLOW_END2(category_group, name, id, arg1_name, \ |
924 arg1_val, arg2_name, arg2_val) \ | 924 arg1_val, arg2_name, arg2_val) \ |
925 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ | 925 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ |
926 name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ | 926 name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ |
927 arg1_val, arg2_name, arg2_val) | 927 arg1_val, arg2_name, arg2_val) |
928 | 928 |
| 929 // Records a clock sync event. |
| 930 #define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id) \ |
| 931 INTERNAL_TRACE_EVENT_ADD( \ |
| 932 TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \ |
| 933 TRACE_EVENT_FLAG_NONE, "sync_id", sync_id) |
| 934 #define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts) \ |
| 935 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ |
| 936 TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \ |
| 937 issue_end_ts.ToInternalValue(), TRACE_EVENT_FLAG_NONE, \ |
| 938 "sync_id", sync_id, "issue_ts", issue_ts.ToInternalValue()) |
| 939 |
929 // Macros to track the life time and value of arbitrary client objects. | 940 // Macros to track the life time and value of arbitrary client objects. |
930 // See also TraceTrackableObject. | 941 // See also TraceTrackableObject. |
931 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ | 942 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ |
932 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 943 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
933 TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, \ | 944 TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, \ |
934 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) | 945 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) |
935 | 946 |
936 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \ | 947 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \ |
937 snapshot) \ | 948 snapshot) \ |
938 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 949 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 #define TRACE_EVENT_PHASE_FLOW_STEP ('t') | 1017 #define TRACE_EVENT_PHASE_FLOW_STEP ('t') |
1007 #define TRACE_EVENT_PHASE_FLOW_END ('f') | 1018 #define TRACE_EVENT_PHASE_FLOW_END ('f') |
1008 #define TRACE_EVENT_PHASE_METADATA ('M') | 1019 #define TRACE_EVENT_PHASE_METADATA ('M') |
1009 #define TRACE_EVENT_PHASE_COUNTER ('C') | 1020 #define TRACE_EVENT_PHASE_COUNTER ('C') |
1010 #define TRACE_EVENT_PHASE_SAMPLE ('P') | 1021 #define TRACE_EVENT_PHASE_SAMPLE ('P') |
1011 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') | 1022 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') |
1012 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') | 1023 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') |
1013 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') | 1024 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') |
1014 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') | 1025 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') |
1015 #define TRACE_EVENT_PHASE_MARK ('R') | 1026 #define TRACE_EVENT_PHASE_MARK ('R') |
| 1027 #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c') |
1016 | 1028 |
1017 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. | 1029 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. |
1018 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) | 1030 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) |
1019 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) | 1031 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) |
1020 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) | 1032 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) |
1021 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) | 1033 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) |
1022 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) | 1034 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) |
1023 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) | 1035 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) |
1024 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) | 1036 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) |
1025 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6)) | 1037 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6)) |
(...skipping 19 matching lines...) Expand all Loading... |
1045 | 1057 |
1046 // Enum reflecting the scope of an INSTANT event. Must fit within | 1058 // Enum reflecting the scope of an INSTANT event. Must fit within |
1047 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1059 // TRACE_EVENT_FLAG_SCOPE_MASK. |
1048 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1060 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
1049 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1061 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
1050 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1062 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
1051 | 1063 |
1052 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1064 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
1053 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1065 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
1054 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1066 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
OLD | NEW |