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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
910 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ | 910 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ |
911 do { \ | 911 do { \ |
912 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 912 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
913 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 913 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
914 *ret = true; \ | 914 *ret = true; \ |
915 } else { \ | 915 } else { \ |
916 *ret = false; \ | 916 *ret = false; \ |
917 } \ | 917 } \ |
918 } while (0) | 918 } while (0) |
919 | 919 |
920 // Macro to explicitly enable a given category group. | |
nduca
2015/07/23 17:00:53
Can you add some explanation text on when you have
xhwang
2015/07/23 22:24:08
Done.
| |
921 #define TRACE_EVENT_INIT_CATEGORY(category_group) \ | |
922 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group) | |
923 | |
920 // Macro to efficiently determine, through polling, if a new trace has begun. | 924 // Macro to efficiently determine, through polling, if a new trace has begun. |
921 #define TRACE_EVENT_IS_NEW_TRACE(ret) \ | 925 #define TRACE_EVENT_IS_NEW_TRACE(ret) \ |
922 do { \ | 926 do { \ |
923 static int INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = 0; \ | 927 static int INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = 0; \ |
924 int num_traces_recorded = TRACE_EVENT_API_GET_NUM_TRACES_RECORDED(); \ | 928 int num_traces_recorded = TRACE_EVENT_API_GET_NUM_TRACES_RECORDED(); \ |
925 if (num_traces_recorded != -1 && \ | 929 if (num_traces_recorded != -1 && \ |
926 num_traces_recorded != \ | 930 num_traces_recorded != \ |
927 INTERNAL_TRACE_EVENT_UID(lastRecordingNumber)) { \ | 931 INTERNAL_TRACE_EVENT_UID(lastRecordingNumber)) { \ |
928 INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = \ | 932 INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = \ |
929 num_traces_recorded; \ | 933 num_traces_recorded; \ |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1746 const char* name_; | 1750 const char* name_; |
1747 IDType id_; | 1751 IDType id_; |
1748 | 1752 |
1749 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1753 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1750 }; | 1754 }; |
1751 | 1755 |
1752 } // namespace trace_event | 1756 } // namespace trace_event |
1753 } // namespace base | 1757 } // namespace base |
1754 | 1758 |
1755 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 1759 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
OLD | NEW |