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

Side by Side Diff: third_party/WebKit/Source/platform/TraceEventCommon.h

Issue 1499683002: tracing: Add macros for generating context trace events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ 927 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
928 TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \ 928 TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \
929 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, \ 929 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, \
930 TRACE_EVENT_FLAG_NONE, "snapshot", snapshot) 930 TRACE_EVENT_FLAG_NONE, "snapshot", snapshot)
931 931
932 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ 932 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \
933 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ 933 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
934 TRACE_EVENT_PHASE_DELETE_OBJECT, category_group, name, \ 934 TRACE_EVENT_PHASE_DELETE_OBJECT, category_group, name, \
935 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) 935 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE)
936 936
937 // Entering and leaving trace event contexts. |category_group| and |name|
938 // specify the context category and type. |context| represents a snapshotted
939 // context object.
940 #define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context) \
941 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ENTER_CONTEXT, category_g roup, \
942 name, TRACE_ID_DONT_MANGLE(context), \
943 TRACE_EVENT_FLAG_NONE)
944 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \
945 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_g roup, \
946 name, TRACE_ID_DONT_MANGLE(context), \
947 TRACE_EVENT_FLAG_NONE)
948 #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \
949 INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context)
950
937 // Macro to efficiently determine if a given category group is enabled. 951 // Macro to efficiently determine if a given category group is enabled.
938 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ 952 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \
939 do { \ 953 do { \
940 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ 954 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
941 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ 955 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
942 *ret = true; \ 956 *ret = true; \
943 } else { \ 957 } else { \
944 *ret = false; \ 958 *ret = false; \
945 } \ 959 } \
946 } while (0) 960 } while (0)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 #define TRACE_EVENT_PHASE_FLOW_STEP ('t') 1003 #define TRACE_EVENT_PHASE_FLOW_STEP ('t')
990 #define TRACE_EVENT_PHASE_FLOW_END ('f') 1004 #define TRACE_EVENT_PHASE_FLOW_END ('f')
991 #define TRACE_EVENT_PHASE_METADATA ('M') 1005 #define TRACE_EVENT_PHASE_METADATA ('M')
992 #define TRACE_EVENT_PHASE_COUNTER ('C') 1006 #define TRACE_EVENT_PHASE_COUNTER ('C')
993 #define TRACE_EVENT_PHASE_SAMPLE ('P') 1007 #define TRACE_EVENT_PHASE_SAMPLE ('P')
994 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') 1008 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
995 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') 1009 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O')
996 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') 1010 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
997 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v') 1011 #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v')
998 #define TRACE_EVENT_PHASE_MARK ('R') 1012 #define TRACE_EVENT_PHASE_MARK ('R')
1013 #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(')
1014 #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')')
999 1015
1000 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. 1016 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
1001 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) 1017 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0))
1002 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0)) 1018 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0))
1003 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1)) 1019 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1))
1004 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2)) 1020 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2))
1005 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3)) 1021 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3))
1006 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4)) 1022 #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4))
1007 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5)) 1023 #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5))
1008 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6)) 1024 #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6))
(...skipping 18 matching lines...) Expand all
1027 1043
1028 // Enum reflecting the scope of an INSTANT event. Must fit within 1044 // Enum reflecting the scope of an INSTANT event. Must fit within
1029 // TRACE_EVENT_FLAG_SCOPE_MASK. 1045 // TRACE_EVENT_FLAG_SCOPE_MASK.
1030 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) 1046 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3))
1031 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) 1047 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3))
1032 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) 1048 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3))
1033 1049
1034 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') 1050 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
1035 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') 1051 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
1036 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') 1052 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t')
OLDNEW
« base/trace_event/trace_event.h ('K') | « third_party/WebKit/Source/platform/TraceEvent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698