Chromium Code Reviews| 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 781 | 781 |
| 782 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ | 782 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ |
| 783 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \ | 783 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \ |
| 784 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) | 784 category_group, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE) |
| 785 | 785 |
| 786 #define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \ | 786 #define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \ |
| 787 UNLIKELY(*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \ | 787 UNLIKELY(*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \ |
| 788 (base::debug::TraceLog::ENABLED_FOR_RECORDING | \ | 788 (base::debug::TraceLog::ENABLED_FOR_RECORDING | \ |
| 789 base::debug::TraceLog::ENABLED_FOR_EVENT_CALLBACK)) | 789 base::debug::TraceLog::ENABLED_FOR_EVENT_CALLBACK)) |
| 790 | 790 |
| 791 // Macros to track GPU timings much like the CPU variants. | |
| 792 #define TRACE_GPU_EVENT_BEGIN0(context, category_group, name) \ | |
| 793 do { \ | |
| 794 context->TraceBeginCHROMIUM(category_group, name); \ | |
|
vmiura
2014/12/09 00:18:10
I think we should check if the category is enabled
| |
| 795 } while (0) | |
| 796 | |
| 797 #define TRACE_GPU_EVENT_END0(context) \ | |
| 798 do { \ | |
| 799 context->TraceEndCHROMIUM(); \ | |
| 800 } while (0) | |
| 801 | |
| 791 // Macro to efficiently determine if a given category group is enabled. | 802 // Macro to efficiently determine if a given category group is enabled. |
| 792 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ | 803 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ |
| 793 do { \ | 804 do { \ |
| 794 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 805 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
| 795 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 806 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
| 796 *ret = true; \ | 807 *ret = true; \ |
| 797 } else { \ | 808 } else { \ |
| 798 *ret = false; \ | 809 *ret = false; \ |
| 799 } \ | 810 } \ |
| 800 } while (0) | 811 } while (0) |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1570 const char* name_; | 1581 const char* name_; |
| 1571 IDType id_; | 1582 IDType id_; |
| 1572 | 1583 |
| 1573 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1584 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
| 1574 }; | 1585 }; |
| 1575 | 1586 |
| 1576 } // namespace debug | 1587 } // namespace debug |
| 1577 } // namespace base | 1588 } // namespace base |
| 1578 | 1589 |
| 1579 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ | 1590 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ |
| OLD | NEW |