| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project 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 #ifndef SRC_TRACING_TRACE_EVENT_H_ | 5 #ifndef SRC_TRACING_TRACE_EVENT_H_ |
| 6 #define SRC_TRACING_TRACE_EVENT_H_ | 6 #define SRC_TRACING_TRACE_EVENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/trace_event/common/trace_event_common.h" | 10 #include "base/trace_event/common/trace_event_common.h" |
| 11 #include "include/v8-platform.h" | 11 #include "include/v8-platform.h" |
| 12 #include "src/base/atomicops.h" | 12 #include "src/base/atomicops.h" |
| 13 | 13 |
| 14 // This header file defines implementation details of how the trace macros in | 14 // This header file defines implementation details of how the trace macros in |
| 15 // trace_event_common.h collect and store trace events. Anything not | 15 // trace_event_common.h collect and store trace events. Anything not |
| 16 // implementation-specific should go in trace_macros_common.h instead of here. | 16 // implementation-specific should go in trace_macros_common.h instead of here. |
| 17 | 17 |
| 18 | 18 |
| 19 // The pointer returned from GetCategoryGroupEnabled() points to a | 19 // The pointer returned from GetCategoryGroupEnabled() points to a |
| 20 // value with zero or more of the following bits. Used in this class only. | 20 // value with zero or more of the following bits. Used in this class only. |
| 21 // The TRACE_EVENT macros should only use the value as a bool. | 21 // The TRACE_EVENT macros should only use the value as a bool. |
| 22 // These values must be in sync with macro values in trace_log.h in | 22 // These values must be in sync with macro values in trace_log.h in |
| 23 // chromium. | 23 // chromium. |
| 24 enum CategoryGroupEnabledFlags { | 24 enum CategoryGroupEnabledFlags { |
| 25 // Category group enabled for the recording mode. | 25 // Category group enabled for the recording mode. |
| 26 kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0, | 26 kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0, |
| 27 // Category group enabled for the monitoring mode. | |
| 28 kEnabledForMonitoring_CategoryGroupEnabledFlags = 1 << 1, | |
| 29 // Category group enabled by SetEventCallbackEnabled(). | 27 // Category group enabled by SetEventCallbackEnabled(). |
| 30 kEnabledForEventCallback_CategoryGroupEnabledFlags = 1 << 2, | 28 kEnabledForEventCallback_CategoryGroupEnabledFlags = 1 << 2, |
| 31 // Category group enabled to export events to ETW. | 29 // Category group enabled to export events to ETW. |
| 32 kEnabledForETWExport_CategoryGroupEnabledFlags = 1 << 3, | 30 kEnabledForETWExport_CategoryGroupEnabledFlags = 1 << 3, |
| 33 }; | 31 }; |
| 34 | 32 |
| 35 // By default, const char* asrgument values are assumed to have long-lived scope | 33 // By default, const char* asrgument values are assumed to have long-lived scope |
| 36 // and will not be copied. Use this macro to force a const char* to be copied. | 34 // and will not be copied. Use this macro to force a const char* to be copied. |
| 37 #define TRACE_STR_COPY(str) v8::internal::tracing::TraceStringWithCopy(str) | 35 #define TRACE_STR_COPY(str) v8::internal::tracing::TraceStringWithCopy(str) |
| 38 | 36 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // for best performance when tracing is disabled. | 92 // for best performance when tracing is disabled. |
| 95 // const uint8_t* | 93 // const uint8_t* |
| 96 // TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(const char* category_group) | 94 // TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(const char* category_group) |
| 97 #define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \ | 95 #define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \ |
| 98 v8::internal::tracing::TraceEventHelper::GetCurrentPlatform() \ | 96 v8::internal::tracing::TraceEventHelper::GetCurrentPlatform() \ |
| 99 ->GetCategoryGroupEnabled | 97 ->GetCategoryGroupEnabled |
| 100 | 98 |
| 101 // Get the number of times traces have been recorded. This is used to implement | 99 // Get the number of times traces have been recorded. This is used to implement |
| 102 // the TRACE_EVENT_IS_NEW_TRACE facility. | 100 // the TRACE_EVENT_IS_NEW_TRACE facility. |
| 103 // unsigned int TRACE_EVENT_API_GET_NUM_TRACES_RECORDED() | 101 // unsigned int TRACE_EVENT_API_GET_NUM_TRACES_RECORDED() |
| 104 #define TRACE_EVENT_API_GET_NUM_TRACES_RECORDED \ | 102 #define TRACE_EVENT_API_GET_NUM_TRACES_RECORDED UNIMPLEMENTED() |
| 105 v8::internal::tracing::TraceEventHelper::GetCurrentPlatform() \ | |
| 106 ->getNumTracesRecorded | |
| 107 | 103 |
| 108 // Add a trace event to the platform tracing system. | 104 // Add a trace event to the platform tracing system. |
| 109 // uint64_t TRACE_EVENT_API_ADD_TRACE_EVENT( | 105 // uint64_t TRACE_EVENT_API_ADD_TRACE_EVENT( |
| 110 // char phase, | 106 // char phase, |
| 111 // const uint8_t* category_group_enabled, | 107 // const uint8_t* category_group_enabled, |
| 112 // const char* name, | 108 // const char* name, |
| 113 // uint64_t id, | 109 // uint64_t id, |
| 114 // uint64_t bind_id, | 110 // uint64_t bind_id, |
| 115 // int num_args, | 111 // int num_args, |
| 116 // const char** arg_names, | 112 // const char** arg_names, |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 522 |
| 527 private: | 523 private: |
| 528 const char* previous_state_; | 524 const char* previous_state_; |
| 529 }; | 525 }; |
| 530 | 526 |
| 531 } // namespace tracing | 527 } // namespace tracing |
| 532 } // namespace internal | 528 } // namespace internal |
| 533 } // namespace v8 | 529 } // namespace v8 |
| 534 | 530 |
| 535 #endif // SRC_TRACING_TRACE_EVENT_H_ | 531 #endif // SRC_TRACING_TRACE_EVENT_H_ |
| OLD | NEW |