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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
627 arg1_name, arg1_val, arg2_name, arg2_val) | 627 arg1_name, arg1_val, arg2_name, arg2_val) |
628 | 628 |
629 // Similar to TRACE_EVENT_ASYNC_ENDx but with a custom |at| timestamp provided. | 629 // Similar to TRACE_EVENT_ASYNC_ENDx but with a custom |at| timestamp provided. |
630 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, \ | 630 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, \ |
631 name, id, timestamp) \ | 631 name, id, timestamp) \ |
632 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ | 632 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
633 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ | 633 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ |
634 static_cast<int>(base::PlatformThread::CurrentId()), \ | 634 static_cast<int>(base::PlatformThread::CurrentId()), \ |
635 timestamp, TRACE_EVENT_FLAG_NONE) | 635 timestamp, TRACE_EVENT_FLAG_NONE) |
636 | 636 |
637 | |
638 // Records a single NET_LOG_BEGIN event called "name" immediately, with 2 | |
639 // associated arguments. If the category is not enabled, then this | |
nduca
2014/09/03 05:37:23
not just 2
xunjieli
2014/09/03 14:51:09
There are two associated arguments right? arg1 and
| |
640 // does nothing. | |
641 // - category and name strings must have application lifetime (statics or | |
642 // literals). They may not include " chars. | |
643 // - |id| is used to match the NET_LOG_BEGIN event with the NET_LOG_END event. | |
644 // Events are considered to match if their category_group, name and id values | |
645 // all match. |id| must either be a pointer or an integer value up to 64 bits. | |
646 // If it's a pointer, the bits will be xored with a hash of the process ID so | |
647 // that the same pointer on two different processes will not collide. | |
648 // NET_LOG_ events are supposed to be used for logging NetLog events only. | |
nduca
2014/09/03 05:37:24
Please retitle to nestable_async_*.
Tracing is ne
xunjieli
2014/09/03 14:51:09
Done. Since dsinclair mentioned that the existing
| |
649 | |
650 #define TRACE_EVENT_NET_LOG_BEGIN2(category_group, name, id, arg1_name, \ | |
651 arg1_val, arg2_name, arg2_val) \ | |
652 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NET_LOG_BEGIN, \ | |
653 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ | |
654 arg2_name, arg2_val) | |
655 // Records a single NET_LOG_END event for "name" immediately. If the category | |
656 // is not enabled, then this does nothing. | |
657 #define TRACE_EVENT_NET_LOG_END2(category_group, name, id, arg1_name, arg1_val, \ | |
658 arg2_name, arg2_val) \ | |
659 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NET_LOG_END, \ | |
660 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ | |
661 arg2_name, arg2_val) | |
662 // Records a single NET_LOG_INSTANT event for "name" immediately. | |
663 // If the category is not enabled, then this does nothing. | |
664 #define TRACE_EVENT_NET_LOG_INSTANT2(category_group, name, id, arg1_name, \ | |
665 arg1_val, arg2_name, arg2_val) \ | |
666 INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NET_LOG_INSTANT, \ | |
667 category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ | |
668 arg2_name, arg2_val) | |
669 | |
637 // Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 | 670 // Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 |
638 // associated arguments. If the category is not enabled, then this | 671 // associated arguments. If the category is not enabled, then this |
639 // does nothing. | 672 // does nothing. |
640 // - category and name strings must have application lifetime (statics or | 673 // - category and name strings must have application lifetime (statics or |
641 // literals). They may not include " chars. | 674 // literals). They may not include " chars. |
642 // - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW | 675 // - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW |
643 // events are considered to match if their category_group, name and id values | 676 // events are considered to match if their category_group, name and id values |
644 // all match. |id| must either be a pointer or an integer value up to 64 bits. | 677 // all match. |id| must either be a pointer or an integer value up to 64 bits. |
645 // If it's a pointer, the bits will be xored with a hash of the process ID so | 678 // If it's a pointer, the bits will be xored with a hash of the process ID so |
646 // that the same pointer on two different processes will not collide. | 679 // that the same pointer on two different processes will not collide. |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
965 #define TRACE_EVENT_PHASE_ASYNC_END ('F') | 998 #define TRACE_EVENT_PHASE_ASYNC_END ('F') |
966 #define TRACE_EVENT_PHASE_FLOW_BEGIN ('s') | 999 #define TRACE_EVENT_PHASE_FLOW_BEGIN ('s') |
967 #define TRACE_EVENT_PHASE_FLOW_STEP ('t') | 1000 #define TRACE_EVENT_PHASE_FLOW_STEP ('t') |
968 #define TRACE_EVENT_PHASE_FLOW_END ('f') | 1001 #define TRACE_EVENT_PHASE_FLOW_END ('f') |
969 #define TRACE_EVENT_PHASE_METADATA ('M') | 1002 #define TRACE_EVENT_PHASE_METADATA ('M') |
970 #define TRACE_EVENT_PHASE_COUNTER ('C') | 1003 #define TRACE_EVENT_PHASE_COUNTER ('C') |
971 #define TRACE_EVENT_PHASE_SAMPLE ('P') | 1004 #define TRACE_EVENT_PHASE_SAMPLE ('P') |
972 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') | 1005 #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N') |
973 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') | 1006 #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O') |
974 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') | 1007 #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D') |
1008 #define TRACE_EVENT_PHASE_NET_LOG_BEGIN ('x') | |
xunjieli
2014/09/02 20:21:46
Any letters that I can use? is x, y, z okay?
nduca
2014/09/03 05:37:24
how about looking at the other ones and thinking a
xunjieli
2014/09/03 14:51:10
Done.
On 2014/09/03 05:37:24, nduca wrote:
| |
1009 #define TRACE_EVENT_PHASE_NET_LOG_END ('y') | |
1010 #define TRACE_EVENT_PHASE_NET_LOG_INSTANT ('z') | |
975 | 1011 |
976 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. | 1012 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. |
977 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) | 1013 #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned char>(0)) |
978 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) | 1014 #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned char>(1 << 0)) |
979 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) | 1015 #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned char>(1 << 1)) |
980 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) | 1016 #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned char>(1 << 2)) |
981 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 3)) | 1017 #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned char>(1 << 3)) |
982 | 1018 |
983 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \ | 1019 #define TRACE_EVENT_FLAG_SCOPE_MASK (static_cast<unsigned char>( \ |
984 TRACE_EVENT_FLAG_SCOPE_OFFSET | (TRACE_EVENT_FLAG_SCOPE_OFFSET << 1))) | 1020 TRACE_EVENT_FLAG_SCOPE_OFFSET | (TRACE_EVENT_FLAG_SCOPE_OFFSET << 1))) |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1526 const char* name_; | 1562 const char* name_; |
1527 IDType id_; | 1563 IDType id_; |
1528 | 1564 |
1529 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1565 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1530 }; | 1566 }; |
1531 | 1567 |
1532 } // namespace debug | 1568 } // namespace debug |
1533 } // namespace base | 1569 } // namespace base |
1534 | 1570 |
1535 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ | 1571 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ |
OLD | NEW |