OLD | NEW |
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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ | 596 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ |
597 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) | 597 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) |
598 | 598 |
599 // Similar to TRACE_EVENT_ASYNC_BEGINx but with a custom |at| timestamp | 599 // Similar to TRACE_EVENT_ASYNC_BEGINx but with a custom |at| timestamp |
600 // provided. | 600 // provided. |
601 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ | 601 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ |
602 timestamp) \ | 602 timestamp) \ |
603 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ | 603 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
604 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ | 604 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ |
605 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) | 605 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) |
| 606 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( \ |
| 607 category_group, name, id, timestamp, arg1_name, arg1_val) \ |
| 608 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
| 609 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ |
| 610 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ |
| 611 arg1_name, arg1_val) |
606 #define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ | 612 #define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ |
607 timestamp) \ | 613 timestamp) \ |
608 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ | 614 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
609 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ | 615 TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ |
610 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) | 616 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) |
611 | 617 |
612 // Records a single ASYNC_STEP_INTO event for |step| immediately. If the | 618 // Records a single ASYNC_STEP_INTO event for |step| immediately. If the |
613 // category is not enabled, then this does nothing. The |name| and |id| must | 619 // category is not enabled, then this does nothing. The |name| and |id| must |
614 // match the ASYNC_BEGIN event above. The |step| param identifies this step | 620 // match the ASYNC_BEGIN event above. The |step| param identifies this step |
615 // within the async event. This should be called at the beginning of the next | 621 // within the async event. This should be called at the beginning of the next |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 685 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
680 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ | 686 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ |
681 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) | 687 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) |
682 | 688 |
683 // Similar to TRACE_EVENT_ASYNC_ENDx but with a custom |at| timestamp provided. | 689 // Similar to TRACE_EVENT_ASYNC_ENDx but with a custom |at| timestamp provided. |
684 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \ | 690 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \ |
685 timestamp) \ | 691 timestamp) \ |
686 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ | 692 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
687 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ | 693 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ |
688 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) | 694 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) |
| 695 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP1(category_group, name, id, \ |
| 696 timestamp, arg1_name, arg1_val) \ |
| 697 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
| 698 TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ |
| 699 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ |
| 700 arg1_name, arg1_val) |
689 | 701 |
690 // NESTABLE_ASYNC_* APIs are used to describe an async operation, which can | 702 // NESTABLE_ASYNC_* APIs are used to describe an async operation, which can |
691 // be nested within a NESTABLE_ASYNC event and/or have inner NESTABLE_ASYNC | 703 // be nested within a NESTABLE_ASYNC event and/or have inner NESTABLE_ASYNC |
692 // events. | 704 // events. |
693 // - category and name strings must have application lifetime (statics or | 705 // - category and name strings must have application lifetime (statics or |
694 // literals). They may not include " chars. | 706 // literals). They may not include " chars. |
695 // - A pair of NESTABLE_ASYNC_BEGIN event and NESTABLE_ASYNC_END event is | 707 // - A pair of NESTABLE_ASYNC_BEGIN event and NESTABLE_ASYNC_END event is |
696 // considered as a match if their category_group, name and id all match. | 708 // considered as a match if their category_group, name and id all match. |
697 // - |id| must either be a pointer or an integer value up to 64 bits. | 709 // - |id| must either be a pointer or an integer value up to 64 bits. |
698 // If it's a pointer, the bits will be xored with a hash of the process ID so | 710 // If it's a pointer, the bits will be xored with a hash of the process ID so |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 | 1041 |
1030 // Enum reflecting the scope of an INSTANT event. Must fit within | 1042 // Enum reflecting the scope of an INSTANT event. Must fit within |
1031 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1043 // TRACE_EVENT_FLAG_SCOPE_MASK. |
1032 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1044 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
1033 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1045 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
1034 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1046 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
1035 | 1047 |
1036 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1048 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
1037 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1049 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
1038 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1050 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
OLD | NEW |