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 | 5 |
6 /* From dev/ppb_trace_event_dev.idl modified Wed Jan 2 16:11:35 2013. */ | 6 /* From dev/ppb_trace_event_dev.idl modified Thu Jun 20 11:20:06 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_TRACE_EVENT_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_TRACE_EVENT_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_TRACE_EVENT_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_TRACE_EVENT_DEV_H_ |
10 | 10 |
11 #include "ppapi/c/pp_macros.h" | 11 #include "ppapi/c/pp_macros.h" |
12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
13 | 13 |
14 #define PPB_TRACE_EVENT_DEV_INTERFACE_0_1 "PPB_Trace_Event(Dev);0.1" | 14 #define PPB_TRACE_EVENT_DEV_INTERFACE_0_1 "PPB_Trace_Event(Dev);0.1" |
15 #define PPB_TRACE_EVENT_DEV_INTERFACE PPB_TRACE_EVENT_DEV_INTERFACE_0_1 | 15 #define PPB_TRACE_EVENT_DEV_INTERFACE_0_2 "PPB_Trace_Event(Dev);0.2" |
| 16 #define PPB_TRACE_EVENT_DEV_INTERFACE PPB_TRACE_EVENT_DEV_INTERFACE_0_2 |
16 | 17 |
17 /** | 18 /** |
18 * @file | 19 * @file |
19 * This file defines the <code>PPB_Trace_Event</code> interface. It is meant | 20 * This file defines the <code>PPB_Trace_Event</code> interface. It is meant |
20 * to be used in plugins as the API that trace macros from trace_event.h use. | 21 * to be used in plugins as the API that trace macros from trace_event.h use. |
21 */ | 22 */ |
22 | 23 |
23 | 24 |
24 /** | 25 /** |
25 * @addtogroup Interfaces | 26 * @addtogroup Interfaces |
26 * @{ | 27 * @{ |
27 */ | 28 */ |
28 struct PPB_Trace_Event_Dev_0_1 { | 29 struct PPB_Trace_Event_Dev_0_2 { |
29 /** | 30 /** |
30 * Gets a pointer to a character for identifying a category name in the | 31 * Gets a pointer to a character for identifying a category name in the |
31 * tracing system as well as for being able to early exit in client-side | 32 * tracing system as well as for being able to early exit in client-side |
32 * tracing code. | 33 * tracing code. |
33 * | 34 * |
34 * NB: This mem_t return value should technically be const, but return values | 35 * NB: This mem_t return value should technically be const, but return values |
35 * for Pepper IDL of mem_t type are not const. The same is true for the arg | 36 * for Pepper IDL of mem_t type are not const. The same is true for the arg |
36 * |category_enabled| for AddTraceEvent. | 37 * |category_enabled| for AddTraceEvent. |
37 */ | 38 */ |
38 void* (*GetCategoryEnabled)(const char* category_name); | 39 void* (*GetCategoryEnabled)(const char* category_name); |
39 /** | 40 /** |
40 * Adds a trace event to the platform tracing system. This function call is | 41 * Adds a trace event to the platform tracing system. This function call is |
41 * usually the result of a TRACE_* macro from trace_event.h when tracing and | 42 * usually the result of a TRACE_* macro from trace_event.h when tracing and |
42 * the category of the particular trace are enabled. It is not advisable to | 43 * the category of the particular trace are enabled. It is not advisable to |
43 * call this function on its own; it is really only meant to be used by the | 44 * call this function on its own; it is really only meant to be used by the |
44 * trace macros. | 45 * trace macros. |
45 */ | 46 */ |
46 void (*AddTraceEvent)(int8_t phase, | 47 void (*AddTraceEvent)(int8_t phase, |
47 const void* category_enabled, | 48 const void* category_enabled, |
48 const char* name, | 49 const char* name, |
49 uint64_t id, | 50 uint64_t id, |
50 uint32_t num_args, | 51 uint32_t num_args, |
51 const char* arg_names[], | 52 const char* arg_names[], |
52 const uint8_t arg_types[], | 53 const uint8_t arg_types[], |
53 const uint64_t arg_values[], | 54 const uint64_t arg_values[], |
54 uint8_t flags); | 55 uint8_t flags); |
55 /** | 56 /** |
| 57 * Adds a trace event to the platform tracing system. This function call is |
| 58 * usually the result of a TRACE_* macro from trace_event.h when tracing and |
| 59 * the category of the particular trace are enabled. It is not advisable to |
| 60 * call this function on its own; it is really only meant to be used by the |
| 61 * trace macros. |
| 62 */ |
| 63 void (*AddTraceEventWithThreadIdAndTimestamp)(int8_t phase, |
| 64 const void* category_enabled, |
| 65 const char* name, |
| 66 uint64_t id, |
| 67 int32_t thread_id, |
| 68 int64_t timestamp, |
| 69 uint32_t num_args, |
| 70 const char* arg_names[], |
| 71 const uint8_t arg_types[], |
| 72 const uint64_t arg_values[], |
| 73 uint8_t flags); |
| 74 /** |
56 * Sets the thread name of the calling thread in the tracing system so it will | 75 * Sets the thread name of the calling thread in the tracing system so it will |
57 * show up properly in chrome://tracing. | 76 * show up properly in chrome://tracing. |
58 */ | 77 */ |
59 void (*SetThreadName)(const char* thread_name); | 78 void (*SetThreadName)(const char* thread_name); |
60 }; | 79 }; |
61 | 80 |
62 typedef struct PPB_Trace_Event_Dev_0_1 PPB_Trace_Event_Dev; | 81 typedef struct PPB_Trace_Event_Dev_0_2 PPB_Trace_Event_Dev; |
| 82 |
| 83 struct PPB_Trace_Event_Dev_0_1 { |
| 84 void* (*GetCategoryEnabled)(const char* category_name); |
| 85 void (*AddTraceEvent)(int8_t phase, |
| 86 const void* category_enabled, |
| 87 const char* name, |
| 88 uint64_t id, |
| 89 uint32_t num_args, |
| 90 const char* arg_names[], |
| 91 const uint8_t arg_types[], |
| 92 const uint64_t arg_values[], |
| 93 uint8_t flags); |
| 94 void (*SetThreadName)(const char* thread_name); |
| 95 }; |
63 /** | 96 /** |
64 * @} | 97 * @} |
65 */ | 98 */ |
66 | 99 |
67 #endif /* PPAPI_C_DEV_PPB_TRACE_EVENT_DEV_H_ */ | 100 #endif /* PPAPI_C_DEV_PPB_TRACE_EVENT_DEV_H_ */ |
68 | 101 |
OLD | NEW |