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

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

Issue 2040663002: Tracing: Added necessary plumbing to make sure clocksync metadata events are always included. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/memory_dump_manager.cc » ('j') | no next file with comments »
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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 arg1_val, arg2_name, arg2_val) 927 arg1_val, arg2_name, arg2_val)
928 928
929 // Special trace event macro to trace task execution with the location where it 929 // Special trace event macro to trace task execution with the location where it
930 // was posted from. 930 // was posted from.
931 #define TRACE_TASK_EXECUTION(run_function, task) \ 931 #define TRACE_TASK_EXECUTION(run_function, task) \
932 INTERNAL_TRACE_TASK_EXECUTION(run_function, task) 932 INTERNAL_TRACE_TASK_EXECUTION(run_function, task)
933 933
934 // TRACE_EVENT_METADATA* events are information related to other 934 // TRACE_EVENT_METADATA* events are information related to other
935 // injected events, not events in their own right. 935 // injected events, not events in their own right.
936 #define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \ 936 #define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \
937 INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, arg1_name, arg1_val) 937 INTERNAL_TRACE_EVENT_METADATA_ADD_IF_ENABLED(category_group, name, \
938 arg1_name, arg1_val)
938 939
940 #define TRACE_EVENT_METADATA_FORCED1(name, arg1_name, arg1_val) \
941 INTERNAL_TRACE_EVENT_METADATA_ADD_FORCED(TRACE_EVENT_PHASE_METADATA, name, \
942 arg1_name, arg1_val)
939 // Records a clock sync event. 943 // Records a clock sync event.
940 #define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id) \ 944 #define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id) \
941 INTERNAL_TRACE_EVENT_ADD( \ 945 INTERNAL_TRACE_EVENT_METADATA_ADD_FORCED(TRACE_EVENT_PHASE_CLOCK_SYNC, \
942 TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \ 946 "clock_sync", "sync_id", sync_id)
943 TRACE_EVENT_FLAG_NONE, "sync_id", sync_id) 947
944 #define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts) \ 948 #define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts) \
945 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ 949 INTERNAL_TRACE_EVENT_METADATA_ADD_FORCED_WITH_TIMESTAMP( \
946 TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \ 950 TRACE_EVENT_PHASE_CLOCK_SYNC, "clock_sync", \
947 issue_end_ts.ToInternalValue(), TRACE_EVENT_FLAG_NONE, \ 951 issue_end_ts.ToInternalValue(), "sync_id", sync_id, "issue_ts", \
948 "sync_id", sync_id, "issue_ts", issue_ts.ToInternalValue()) 952 issue_ts.ToInternalValue())
949 953
950 // Macros to track the life time and value of arbitrary client objects. 954 // Macros to track the life time and value of arbitrary client objects.
951 // See also TraceTrackableObject. 955 // See also TraceTrackableObject.
952 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ 956 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \
953 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ 957 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
954 TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, \ 958 TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, \
955 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) 959 TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE)
956 960
957 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \ 961 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \
958 snapshot) \ 962 snapshot) \
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 1088
1085 // Enum reflecting the scope of an INSTANT event. Must fit within 1089 // Enum reflecting the scope of an INSTANT event. Must fit within
1086 // TRACE_EVENT_FLAG_SCOPE_MASK. 1090 // TRACE_EVENT_FLAG_SCOPE_MASK.
1087 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) 1091 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3))
1088 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) 1092 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3))
1089 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) 1093 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3))
1090 1094
1091 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') 1095 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
1092 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') 1096 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
1093 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') 1097 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t')
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698