Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: base/trace_event/common/trace_event_common.h

Issue 2142023003: Binds two IDs together. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit tests + inline documentation Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_event.h » ('j') | base/trace_event/trace_event.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, \ 980 TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, \
981 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE) 981 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE)
982 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ 982 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \
983 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ 983 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
984 TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, \ 984 TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, \
985 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE) 985 TRACE_ID_DONT_MANGLE(context), TRACE_EVENT_FLAG_NONE)
986 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ 986 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \
987 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, \ 987 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, \
988 TRACE_ID_DONT_MANGLE(context)) 988 TRACE_ID_DONT_MANGLE(context))
989 989
990 // Macro to specify that two trace IDs are identical. For example,
991 // TRACE_BIND_CROSS_PROCESS_IDS(
992 // "category", "name",
993 // TRACE_ID_WITH_SCOPE("net::URLRequest", 0x1000),
994 // TRACE_ID_WITH_SCOPE("blink::ResourceFetcher::FetchRequest", 0x2000), 1)
995 // tells the trace consumer that events with ID ("net::URLRequest", 0x1000) from
996 // the current process have the same ID as events with ID
997 // ("blink::ResourceFetcher::FetchRequest", 0x2000) from the process with PID 1.
998 #define TRACE_BIND_IDS(category_group, name, id, bind_id) \
999 INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id);
1000 #define TRACE_BIND_CROSS_PROCESS_IDS( \
1001 category_group, name, id, bind_id, bind_pid) \
1002 INTERNAL_TRACE_EVENT_ADD_BIND_IDS( \
1003 category_group, name, id, bind_id, "bind_pid", bind_pid);
1004
990 // Macro to efficiently determine if a given category group is enabled. 1005 // Macro to efficiently determine if a given category group is enabled.
991 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ 1006 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \
992 do { \ 1007 do { \
993 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ 1008 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
994 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ 1009 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
995 *ret = true; \ 1010 *ret = true; \
996 } else { \ 1011 } else { \
997 *ret = false; \ 1012 *ret = false; \
998 } \ 1013 } \
999 } while (0) 1014 } while (0)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 #define TRACE_EVENT_PHASE_COUNTER ('C') 1060 #define TRACE_EVENT_PHASE_COUNTER ('C')
1046 #define TRACE_EVENT_PHASE_SAMPLE ('P') 1061 #define TRACE_EVENT_PHASE_SAMPLE ('P')
1047 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') 1062 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
1048 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') 1063 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O')
1049 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') 1064 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
1050 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') 1065 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v')
1051 #define TRACE_EVENT_PHASE_MARK ('R') 1066 #define TRACE_EVENT_PHASE_MARK ('R')
1052 #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c') 1067 #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c')
1053 #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(') 1068 #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(')
1054 #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')') 1069 #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')')
1070 #define TRACE_EVENT_PHASE_BIND_IDS ('=')
1055 1071
1056 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. 1072 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
1057 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) 1073 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0))
1058 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) 1074 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0))
1059 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) 1075 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1))
1060 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) 1076 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2))
1061 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) 1077 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3))
1062 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) 1078 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4))
1063 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) 1079 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5))
1064 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6)) 1080 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6))
(...skipping 19 matching lines...) Expand all
1084 1100
1085 // Enum reflecting the scope of an INSTANT event. Must fit within 1101 // Enum reflecting the scope of an INSTANT event. Must fit within
1086 // TRACE_EVENT_FLAG_SCOPE_MASK. 1102 // TRACE_EVENT_FLAG_SCOPE_MASK.
1087 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) 1103 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3))
1088 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) 1104 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3))
1089 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) 1105 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3))
1090 1106
1091 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') 1107 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
1092 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') 1108 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
1093 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') 1109 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t')
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/trace_event.h » ('j') | base/trace_event/trace_event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698