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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 // - |id| is used to match a child NESTABLE_ASYNC event with its parent | 709 // - |id| is used to match a child NESTABLE_ASYNC event with its parent |
710 // NESTABLE_ASYNC event. Therefore, events in the same nested event tree must | 710 // NESTABLE_ASYNC event. Therefore, events in the same nested event tree must |
711 // be logged using the same id and category_group. | 711 // be logged using the same id and category_group. |
712 // | 712 // |
713 // Unmatched NESTABLE_ASYNC_END event will be parsed as an event that starts | 713 // Unmatched NESTABLE_ASYNC_END event will be parsed as an event that starts |
714 // at the first NESTABLE_ASYNC event of that id, and unmatched | 714 // at the first NESTABLE_ASYNC event of that id, and unmatched |
715 // NESTABLE_ASYNC_BEGIN event will be parsed as an event that ends at the last | 715 // NESTABLE_ASYNC_BEGIN event will be parsed as an event that ends at the last |
716 // NESTABLE_ASYNC event of that id. Corresponding warning messages for | 716 // NESTABLE_ASYNC event of that id. Corresponding warning messages for |
717 // unmatched events will be shown in the analysis view. | 717 // unmatched events will be shown in the analysis view. |
718 | 718 |
719 // Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with 2 | 719 // Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with |
720 // associated arguments. If the category is not enabled, then this does nothing. | 720 // 0, 1 or 2 associated arguments. If the category is not enabled, then this |
| 721 // does nothing. |
| 722 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id) \ |
| 723 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ |
| 724 category_group, name, id, TRACE_EVENT_FLAG_NONE) |
| 725 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ |
| 726 arg1_val) \ |
| 727 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ |
| 728 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) |
721 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \ | 729 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \ |
722 arg1_val, arg2_name, arg2_val) \ | 730 arg1_val, arg2_name, arg2_val) \ |
723 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ | 731 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ |
724 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ | 732 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ |
725 arg2_name, arg2_val) | 733 arg2_name, arg2_val) |
| 734 // Records a single NESTABLE_ASYNC_END event called "name" immediately, with 0, |
| 735 // 1, or 2 associated arguments. If the category is not enabled, then this does |
| 736 // nothing. |
| 737 #define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id) \ |
| 738 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ |
| 739 category_group, name, id, TRACE_EVENT_FLAG_NONE) |
| 740 #define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \ |
| 741 arg1_val) \ |
| 742 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ |
| 743 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) |
| 744 #define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \ |
| 745 arg1_val, arg2_name, arg2_val) \ |
| 746 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ |
| 747 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ |
| 748 arg2_name, arg2_val) |
| 749 |
726 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TTS2(category_group, name, \ | 750 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TTS2(category_group, name, \ |
727 id, arg1_name, arg1_val, arg2_name, arg2_val) \ | 751 id, arg1_name, arg1_val, arg2_name, arg2_val) \ |
728 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ | 752 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ |
729 category_group, name, id, \ | 753 category_group, name, id, \ |
730 TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, \ | 754 TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, \ |
731 arg1_name, arg1_val, arg2_name, arg2_val) | 755 arg1_name, arg1_val, arg2_name, arg2_val) |
732 | |
733 // Records a single NESTABLE_ASYNC_END event called "name" immediately, with 2 | |
734 // associated arguments. If the category is not enabled, then this does nothing. | |
735 #define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \ | |
736 arg1_val, arg2_name, arg2_val) \ | |
737 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ | |
738 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ | |
739 arg2_name, arg2_val) | |
740 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2(category_group, name, \ | 756 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2(category_group, name, \ |
741 id, arg1_name, arg1_val, arg2_name, arg2_val) \ | 757 id, arg1_name, arg1_val, arg2_name, arg2_val) \ |
742 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ | 758 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ |
743 category_group, name, id, \ | 759 category_group, name, id, \ |
744 TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, \ | 760 TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, \ |
745 arg1_name, arg1_val, arg2_name, arg2_val) | 761 arg1_name, arg1_val, arg2_name, arg2_val) |
746 | 762 |
747 // Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately, | 763 // Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately, |
748 // with 2 associated arguments. If the category is not enabled, then this | 764 // with 2 associated arguments. If the category is not enabled, then this |
749 // does nothing. | 765 // does nothing. |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 const char* name_; | 1678 const char* name_; |
1663 IDType id_; | 1679 IDType id_; |
1664 | 1680 |
1665 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1681 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1666 }; | 1682 }; |
1667 | 1683 |
1668 } // namespace trace_event | 1684 } // namespace trace_event |
1669 } // namespace base | 1685 } // namespace base |
1670 | 1686 |
1671 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 1687 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
OLD | NEW |