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 defines the set of functions necessary for trace_event_internal.h | 5 // This header defines the set of functions necessary for trace_event_internal.h |
6 // to remain platform and context neutral. To use tracing in another context, | 6 // to remain platform and context neutral. To use tracing in another context, |
7 // copy this header (and trace_event_internal.h) and implement the | 7 // copy this header (and trace_event_internal.h) and implement the |
8 // TRACE_EVENT_API_* macros below for the new environment. | 8 // TRACE_EVENT_API_* macros below for the new environment. |
9 | 9 |
10 #ifndef BASE_DEBUG_TRACE_EVENT_H_ | 10 #ifndef BASE_DEBUG_TRACE_EVENT_H_ |
11 #define BASE_DEBUG_TRACE_EVENT_H_ | 11 #define BASE_DEBUG_TRACE_EVENT_H_ |
12 | 12 |
13 #include "base/atomicops.h" | 13 #include "base/atomicops.h" |
14 #include "base/debug/trace_event_impl.h" | 14 #include "base/debug/trace_event_impl.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 | 16 |
17 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
18 // Implementation specific tracing API definitions. | 18 // Implementation specific tracing API definitions. |
19 | 19 |
20 // Get a pointer to the enabled state of the given trace category. Only | 20 // Get a pointer to the enabled state of the given trace category. Only |
21 // long-lived literal strings should be given as the category name. The returned | 21 // long-lived literal strings should be given as the category group. The |
22 // pointer can be held permanently in a local static for example. If the | 22 // returned pointer can be held permanently in a local static for example. If |
23 // unsigned char is non-zero, tracing is enabled. If tracing is enabled, | 23 // the unsigned char is non-zero, tracing is enabled. If tracing is enabled, |
24 // TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled | 24 // TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled |
25 // between the load of the tracing state and the call to | 25 // between the load of the tracing state and the call to |
26 // TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out | 26 // TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out |
27 // for best performance when tracing is disabled. | 27 // for best performance when tracing is disabled. |
28 // const unsigned char* | 28 // const unsigned char* |
29 // TRACE_EVENT_API_GET_CATEGORY_ENABLED(const char* category_name) | 29 // TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(const char* category_group) |
30 #define TRACE_EVENT_API_GET_CATEGORY_ENABLED \ | 30 #define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \ |
31 base::debug::TraceLog::GetCategoryEnabled | 31 base::debug::TraceLog::GetCategoryGroupEnabled |
32 | 32 |
33 // Add a trace event to the platform tracing system. | 33 // Add a trace event to the platform tracing system. |
34 // void TRACE_EVENT_API_ADD_TRACE_EVENT( | 34 // void TRACE_EVENT_API_ADD_TRACE_EVENT( |
35 // char phase, | 35 // char phase, |
36 // const unsigned char* category_enabled, | 36 // const unsigned char* category_group_enabled, |
37 // const char* name, | 37 // const char* name, |
38 // unsigned long long id, | 38 // unsigned long long id, |
39 // int num_args, | 39 // int num_args, |
40 // const char** arg_names, | 40 // const char** arg_names, |
41 // const unsigned char* arg_types, | 41 // const unsigned char* arg_types, |
42 // const unsigned long long* arg_values, | 42 // const unsigned long long* arg_values, |
43 // unsigned char flags) | 43 // unsigned char flags) |
44 #define TRACE_EVENT_API_ADD_TRACE_EVENT \ | 44 #define TRACE_EVENT_API_ADD_TRACE_EVENT \ |
45 base::debug::TraceLog::GetInstance()->AddTraceEvent | 45 base::debug::TraceLog::GetInstance()->AddTraceEvent |
46 | 46 |
(...skipping 20 matching lines...) Expand all Loading... |
67 base::subtle::NoBarrier_Store(&(var), (value)) | 67 base::subtle::NoBarrier_Store(&(var), (value)) |
68 | 68 |
69 // Defines visibility for classes in trace_event_internal.h | 69 // Defines visibility for classes in trace_event_internal.h |
70 #define TRACE_EVENT_API_CLASS_EXPORT BASE_EXPORT | 70 #define TRACE_EVENT_API_CLASS_EXPORT BASE_EXPORT |
71 | 71 |
72 //////////////////////////////////////////////////////////////////////////////// | 72 //////////////////////////////////////////////////////////////////////////////// |
73 | 73 |
74 #include "base/debug/trace_event_internal.h" | 74 #include "base/debug/trace_event_internal.h" |
75 | 75 |
76 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ | 76 #endif /* BASE_DEBUG_TRACE_EVENT_H_ */ |
OLD | NEW |