| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 arg2_name, arg2_val) \ | 401 arg2_name, arg2_val) \ |
| 402 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ | 402 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ |
| 403 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ | 403 TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ |
| 404 arg2_name, arg2_val) | 404 arg2_name, arg2_val) |
| 405 | 405 |
| 406 #define TRACE_EVENT_MARK(category_group, name) \ | 406 #define TRACE_EVENT_MARK(category_group, name) \ |
| 407 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \ | 407 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \ |
| 408 TRACE_EVENT_FLAG_NONE) | 408 TRACE_EVENT_FLAG_NONE) |
| 409 | 409 |
| 410 #define TRACE_EVENT_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ | 410 #define TRACE_EVENT_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ |
| 411 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK, \ | 411 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(TRACE_EVENT_PHASE_MARK,
\ |
| 412 category_group, name, timestamp, \ | 412 category_group, name, 0, 0, timestamp,
\ |
| 413 TRACE_EVENT_FLAG_NONE) | 413 TRACE_EVENT_FLAG_NONE) |
| 414 | 414 |
| 415 #define TRACE_EVENT_COPY_MARK(category_group, name) \ | 415 #define TRACE_EVENT_COPY_MARK(category_group, name) \ |
| 416 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \ | 416 INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \ |
| 417 TRACE_EVENT_FLAG_COPY) | 417 TRACE_EVENT_FLAG_COPY) |
| 418 | 418 |
| 419 #define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ | 419 #define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ |
| 420 INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK, \ | 420 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(TRACE_EVENT_PHASE_MARK,
\ |
| 421 category_group, name, timestamp, \ | 421 category_group, name, 0, 0, timestamp,
\ |
| 422 TRACE_EVENT_FLAG_COPY) | 422 TRACE_EVENT_FLAG_COPY) |
| 423 | 423 |
| 424 // Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided. | 424 // Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided. |
| 425 // - |id| is used to match the _BEGIN event with the _END event. | 425 // - |id| is used to match the _BEGIN event with the _END event. |
| 426 // Events are considered to match if their category_group, name and id values | 426 // Events are considered to match if their category_group, name and id values |
| 427 // all match. |id| must either be a pointer or an integer value up to 64 bits. | 427 // all match. |id| must either be a pointer or an integer value up to 64 bits. |
| 428 // If it's a pointer, the bits will be xored with a hash of the process ID so | 428 // If it's a pointer, the bits will be xored with a hash of the process ID so |
| 429 // that the same pointer on two different processes will not collide. | 429 // that the same pointer on two different processes will not collide. |
| 430 #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ | 430 #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ |
| 431 thread_id, timestamp) \ | 431 thread_id, timestamp) \ |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) | 783 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) |
| 784 | 784 |
| 785 #define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(category_group, name, \ | 785 #define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(category_group, name, \ |
| 786 id, timestamp) \ | 786 id, timestamp) \ |
| 787 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ | 787 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
| 788 TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ | 788 TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ |
| 789 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) | 789 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) |
| 790 | 790 |
| 791 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( \ | 791 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( \ |
| 792 category_group, name, id, timestamp) \ | 792 category_group, name, id, timestamp) \ |
| 793 INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \ | 793 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
| 794 TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ | 794 TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ |
| 795 timestamp, TRACE_EVENT_FLAG_COPY) | 795 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) |
| 796 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \ | 796 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \ |
| 797 category_group, name, id, timestamp) \ | 797 category_group, name, id, timestamp) \ |
| 798 INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \ | 798 INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ |
| 799 TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ | 799 TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ |
| 800 timestamp, TRACE_EVENT_FLAG_COPY) | 800 TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) |
| 801 | 801 |
| 802 // Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately, | 802 // Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately, |
| 803 // with 2 associated arguments. If the category is not enabled, then this | 803 // with 2 associated arguments. If the category is not enabled, then this |
| 804 // does nothing. | 804 // does nothing. |
| 805 #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( \ | 805 #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( \ |
| 806 category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ | 806 category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ |
| 807 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ | 807 INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ |
| 808 TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \ | 808 TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \ |
| 809 TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) | 809 TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) |
| 810 | 810 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 | 1029 |
| 1030 // Enum reflecting the scope of an INSTANT event. Must fit within | 1030 // Enum reflecting the scope of an INSTANT event. Must fit within |
| 1031 // TRACE_EVENT_FLAG_SCOPE_MASK. | 1031 // TRACE_EVENT_FLAG_SCOPE_MASK. |
| 1032 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) | 1032 #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3)) |
| 1033 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) | 1033 #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3)) |
| 1034 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) | 1034 #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3)) |
| 1035 | 1035 |
| 1036 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') | 1036 #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g') |
| 1037 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') | 1037 #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p') |
| 1038 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') | 1038 #define TRACE_EVENT_SCOPE_NAME_THREAD ('t') |
| OLD | NEW |