Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 1 | #ifndef _LINUX_TRACEPOINT_H |
| 2 | #define _LINUX_TRACEPOINT_H |
| 3 | |
| 4 | /* |
| 5 | * Kernel Tracepoint API. |
| 6 | * |
Li Hong | 8cd09a5 | 2009-09-22 18:00:44 +0800 | [diff] [blame] | 7 | * See Documentation/trace/tracepoints.txt. |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 8 | * |
| 9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
| 10 | * |
| 11 | * Heavily inspired from the Linux Kernel Markers. |
| 12 | * |
| 13 | * This file is released under the GPLv2. |
| 14 | * See the file COPYING for more details. |
| 15 | */ |
| 16 | |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/rcupdate.h> |
| 19 | |
| 20 | struct module; |
| 21 | struct tracepoint; |
| 22 | |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 23 | struct tracepoint_func { |
| 24 | void *func; |
| 25 | void *data; |
| 26 | }; |
| 27 | |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 28 | struct tracepoint { |
| 29 | const char *name; /* Tracepoint name */ |
| 30 | int state; /* State. */ |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 31 | void (*regfunc)(void); |
| 32 | void (*unregfunc)(void); |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 33 | struct tracepoint_func *funcs; |
Mathieu Desnoyers | 7e066fb | 2008-11-14 17:47:47 -0500 | [diff] [blame] | 34 | } __attribute__((aligned(32))); /* |
| 35 | * Aligned on 32 bytes because it is |
| 36 | * globally visible and gcc happily |
| 37 | * align these on the structure size. |
| 38 | * Keep in sync with vmlinux.lds.h. |
| 39 | */ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 40 | |
Steven Rostedt | 2e26ca7 | 2010-05-05 10:52:31 -0400 | [diff] [blame] | 41 | /* |
| 42 | * Connect a probe to a tracepoint. |
| 43 | * Internal API, should not be used directly. |
| 44 | */ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 45 | extern int tracepoint_probe_register(const char *name, void *probe, void *data); |
Steven Rostedt | 2e26ca7 | 2010-05-05 10:52:31 -0400 | [diff] [blame] | 46 | |
| 47 | /* |
| 48 | * Disconnect a probe from a tracepoint. |
| 49 | * Internal API, should not be used directly. |
| 50 | */ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 51 | extern int |
| 52 | tracepoint_probe_unregister(const char *name, void *probe, void *data); |
Steven Rostedt | 2e26ca7 | 2010-05-05 10:52:31 -0400 | [diff] [blame] | 53 | |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 54 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe, |
| 55 | void *data); |
| 56 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe, |
| 57 | void *data); |
Steven Rostedt | 2e26ca7 | 2010-05-05 10:52:31 -0400 | [diff] [blame] | 58 | extern void tracepoint_probe_update_all(void); |
| 59 | |
| 60 | struct tracepoint_iter { |
| 61 | struct module *module; |
| 62 | struct tracepoint *tracepoint; |
| 63 | }; |
| 64 | |
| 65 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); |
| 66 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); |
| 67 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); |
| 68 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); |
| 69 | extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, |
| 70 | struct tracepoint *begin, struct tracepoint *end); |
| 71 | |
| 72 | /* |
| 73 | * tracepoint_synchronize_unregister must be called between the last tracepoint |
| 74 | * probe unregistration and the end of module exit to make sure there is no |
| 75 | * caller executing a probe when it is freed. |
| 76 | */ |
| 77 | static inline void tracepoint_synchronize_unregister(void) |
| 78 | { |
| 79 | synchronize_sched(); |
| 80 | } |
| 81 | |
| 82 | #define PARAMS(args...) args |
| 83 | |
| 84 | #ifdef CONFIG_TRACEPOINTS |
| 85 | extern void tracepoint_update_probe_range(struct tracepoint *begin, |
| 86 | struct tracepoint *end); |
| 87 | #else |
| 88 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, |
| 89 | struct tracepoint *end) |
| 90 | { } |
| 91 | #endif /* CONFIG_TRACEPOINTS */ |
| 92 | |
| 93 | #endif /* _LINUX_TRACEPOINT_H */ |
| 94 | |
| 95 | /* |
| 96 | * Note: we keep the TRACE_EVENT and DECLARE_TRACE outside the include |
| 97 | * file ifdef protection. |
| 98 | * This is due to the way trace events work. If a file includes two |
| 99 | * trace event headers under one "CREATE_TRACE_POINTS" the first include |
| 100 | * will override the TRACE_EVENT and break the second include. |
| 101 | */ |
| 102 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 103 | #ifndef DECLARE_TRACE |
| 104 | |
Steven Rostedt | 2939b04 | 2009-03-09 15:47:18 -0400 | [diff] [blame] | 105 | #define TP_PROTO(args...) args |
Li Hong | 8cd09a5 | 2009-09-22 18:00:44 +0800 | [diff] [blame] | 106 | #define TP_ARGS(args...) args |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 107 | |
| 108 | #ifdef CONFIG_TRACEPOINTS |
| 109 | |
| 110 | /* |
| 111 | * it_func[0] is never NULL because there is at least one element in the array |
| 112 | * when the array itself is non NULL. |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 113 | * |
| 114 | * Note, the proto and args passed in includes "__data" as the first parameter. |
| 115 | * The reason for this is to handle the "void" prototype. If a tracepoint |
| 116 | * has a "void" prototype, then it is invalid to declare a function |
| 117 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just |
| 118 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 119 | */ |
| 120 | #define __DO_TRACE(tp, proto, args) \ |
| 121 | do { \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 122 | struct tracepoint_func *it_func_ptr; \ |
| 123 | void *it_func; \ |
| 124 | void *__data; \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 125 | \ |
Mathieu Desnoyers | da7b3ea | 2008-11-14 17:47:43 -0500 | [diff] [blame] | 126 | rcu_read_lock_sched_notrace(); \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 127 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ |
| 128 | if (it_func_ptr) { \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 129 | do { \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 130 | it_func = (it_func_ptr)->func; \ |
| 131 | __data = (it_func_ptr)->data; \ |
| 132 | ((void(*)(proto))(it_func))(args); \ |
| 133 | } while ((++it_func_ptr)->func); \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 134 | } \ |
Mathieu Desnoyers | da7b3ea | 2008-11-14 17:47:43 -0500 | [diff] [blame] | 135 | rcu_read_unlock_sched_notrace(); \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 136 | } while (0) |
| 137 | |
| 138 | /* |
| 139 | * Make sure the alignment of the structure in the __tracepoints section will |
| 140 | * not add unwanted padding between the beginning of the section and the |
| 141 | * structure. Force alignment to the same alignment as the section start. |
| 142 | */ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 143 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ |
Mathieu Desnoyers | 7e066fb | 2008-11-14 17:47:47 -0500 | [diff] [blame] | 144 | extern struct tracepoint __tracepoint_##name; \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 145 | static inline void trace_##name(proto) \ |
| 146 | { \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 147 | if (unlikely(__tracepoint_##name.state)) \ |
| 148 | __DO_TRACE(&__tracepoint_##name, \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 149 | TP_PROTO(data_proto), \ |
| 150 | TP_ARGS(data_args)); \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 151 | } \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 152 | static inline int \ |
| 153 | register_trace_##name(void (*probe)(data_proto), void *data) \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 154 | { \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 155 | return tracepoint_probe_register(#name, (void *)probe, \ |
| 156 | data); \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 157 | } \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 158 | static inline int \ |
| 159 | unregister_trace_##name(void (*probe)(data_proto), void *data) \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 160 | { \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 161 | return tracepoint_probe_unregister(#name, (void *)probe, \ |
| 162 | data); \ |
Mathieu Desnoyers | 53da59a | 2010-04-30 12:59:59 -0400 | [diff] [blame] | 163 | } \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 164 | static inline void \ |
| 165 | check_trace_callback_type_##name(void (*cb)(data_proto)) \ |
Mathieu Desnoyers | 53da59a | 2010-04-30 12:59:59 -0400 | [diff] [blame] | 166 | { \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 167 | } |
| 168 | |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 169 | #define DEFINE_TRACE_FN(name, reg, unreg) \ |
Mathieu Desnoyers | 7e066fb | 2008-11-14 17:47:47 -0500 | [diff] [blame] | 170 | static const char __tpstrtab_##name[] \ |
| 171 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
| 172 | struct tracepoint __tracepoint_##name \ |
| 173 | __attribute__((section("__tracepoints"), aligned(32))) = \ |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 174 | { __tpstrtab_##name, 0, reg, unreg, NULL } |
| 175 | |
| 176 | #define DEFINE_TRACE(name) \ |
| 177 | DEFINE_TRACE_FN(name, NULL, NULL); |
Mathieu Desnoyers | 7e066fb | 2008-11-14 17:47:47 -0500 | [diff] [blame] | 178 | |
| 179 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) \ |
| 180 | EXPORT_SYMBOL_GPL(__tracepoint_##name) |
| 181 | #define EXPORT_TRACEPOINT_SYMBOL(name) \ |
| 182 | EXPORT_SYMBOL(__tracepoint_##name) |
| 183 | |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 184 | #else /* !CONFIG_TRACEPOINTS */ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 185 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 186 | static inline void trace_##name(proto) \ |
| 187 | { } \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 188 | static inline int \ |
| 189 | register_trace_##name(void (*probe)(data_proto), \ |
| 190 | void *data) \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 191 | { \ |
| 192 | return -ENOSYS; \ |
| 193 | } \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 194 | static inline int \ |
| 195 | unregister_trace_##name(void (*probe)(data_proto), \ |
| 196 | void *data) \ |
Mathieu Desnoyers | c420970 | 2008-11-14 17:47:44 -0500 | [diff] [blame] | 197 | { \ |
| 198 | return -ENOSYS; \ |
Mathieu Desnoyers | 53da59a | 2010-04-30 12:59:59 -0400 | [diff] [blame] | 199 | } \ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 200 | static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \ |
Mathieu Desnoyers | 53da59a | 2010-04-30 12:59:59 -0400 | [diff] [blame] | 201 | { \ |
Mathieu Desnoyers | c420970 | 2008-11-14 17:47:44 -0500 | [diff] [blame] | 202 | } |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 203 | |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 204 | #define DEFINE_TRACE_FN(name, reg, unreg) |
Mathieu Desnoyers | 7e066fb | 2008-11-14 17:47:47 -0500 | [diff] [blame] | 205 | #define DEFINE_TRACE(name) |
| 206 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) |
| 207 | #define EXPORT_TRACEPOINT_SYMBOL(name) |
| 208 | |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 209 | #endif /* CONFIG_TRACEPOINTS */ |
Steven Rostedt | 38516ab | 2010-04-20 17:04:50 -0400 | [diff] [blame^] | 210 | |
| 211 | /* |
| 212 | * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype |
| 213 | * (void). "void" is a special value in a function prototype and can |
| 214 | * not be combined with other arguments. Since the DECLARE_TRACE() |
| 215 | * macro adds a data element at the beginning of the prototype, |
| 216 | * we need a way to differentiate "(void *data, proto)" from |
| 217 | * "(void *data, void)". The second prototype is invalid. |
| 218 | * |
| 219 | * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype |
| 220 | * and "void *__data" as the callback prototype. |
| 221 | * |
| 222 | * DECLARE_TRACE() passes "proto" as the tracepoint protoype and |
| 223 | * "void *__data, proto" as the callback prototype. |
| 224 | */ |
| 225 | #define DECLARE_TRACE_NOARGS(name) \ |
| 226 | __DECLARE_TRACE(name, void, , void *__data, __data) |
| 227 | |
| 228 | #define DECLARE_TRACE(name, proto, args) \ |
| 229 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ |
| 230 | PARAMS(void *__data, proto), \ |
| 231 | PARAMS(__data, args)) |
| 232 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 233 | #endif /* DECLARE_TRACE */ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 234 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 235 | #ifndef TRACE_EVENT |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 236 | /* |
| 237 | * For use with the TRACE_EVENT macro: |
| 238 | * |
| 239 | * We define a tracepoint, its arguments, its printk format |
| 240 | * and its 'fast binay record' layout. |
| 241 | * |
| 242 | * Firstly, name your tracepoint via TRACE_EVENT(name : the |
| 243 | * 'subsystem_event' notation is fine. |
| 244 | * |
| 245 | * Think about this whole construct as the |
| 246 | * 'trace_sched_switch() function' from now on. |
| 247 | * |
| 248 | * |
| 249 | * TRACE_EVENT(sched_switch, |
| 250 | * |
| 251 | * * |
| 252 | * * A function has a regular function arguments |
| 253 | * * prototype, declare it via TP_PROTO(): |
| 254 | * * |
| 255 | * |
Steven Rostedt | ef18012 | 2009-03-10 14:10:56 -0400 | [diff] [blame] | 256 | * TP_PROTO(struct rq *rq, struct task_struct *prev, |
| 257 | * struct task_struct *next), |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 258 | * |
| 259 | * * |
| 260 | * * Define the call signature of the 'function'. |
| 261 | * * (Design sidenote: we use this instead of a |
| 262 | * * TP_PROTO1/TP_PROTO2/TP_PROTO3 ugliness.) |
| 263 | * * |
| 264 | * |
Steven Rostedt | ef18012 | 2009-03-10 14:10:56 -0400 | [diff] [blame] | 265 | * TP_ARGS(rq, prev, next), |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 266 | * |
| 267 | * * |
| 268 | * * Fast binary tracing: define the trace record via |
| 269 | * * TP_STRUCT__entry(). You can think about it like a |
| 270 | * * regular C structure local variable definition. |
| 271 | * * |
| 272 | * * This is how the trace record is structured and will |
| 273 | * * be saved into the ring buffer. These are the fields |
| 274 | * * that will be exposed to user-space in |
GeunSik Lim | 156f5a7 | 2009-06-02 15:01:37 +0900 | [diff] [blame] | 275 | * * /sys/kernel/debug/tracing/events/<*>/format. |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 276 | * * |
| 277 | * * The declared 'local variable' is called '__entry' |
| 278 | * * |
| 279 | * * __field(pid_t, prev_prid) is equivalent to a standard declariton: |
| 280 | * * |
| 281 | * * pid_t prev_pid; |
| 282 | * * |
| 283 | * * __array(char, prev_comm, TASK_COMM_LEN) is equivalent to: |
| 284 | * * |
| 285 | * * char prev_comm[TASK_COMM_LEN]; |
| 286 | * * |
| 287 | * |
| 288 | * TP_STRUCT__entry( |
| 289 | * __array( char, prev_comm, TASK_COMM_LEN ) |
| 290 | * __field( pid_t, prev_pid ) |
| 291 | * __field( int, prev_prio ) |
| 292 | * __array( char, next_comm, TASK_COMM_LEN ) |
| 293 | * __field( pid_t, next_pid ) |
| 294 | * __field( int, next_prio ) |
| 295 | * ), |
| 296 | * |
| 297 | * * |
| 298 | * * Assign the entry into the trace record, by embedding |
| 299 | * * a full C statement block into TP_fast_assign(). You |
| 300 | * * can refer to the trace record as '__entry' - |
| 301 | * * otherwise you can put arbitrary C code in here. |
| 302 | * * |
| 303 | * * Note: this C code will execute every time a trace event |
| 304 | * * happens, on an active tracepoint. |
| 305 | * * |
| 306 | * |
Steven Rostedt | ef18012 | 2009-03-10 14:10:56 -0400 | [diff] [blame] | 307 | * TP_fast_assign( |
| 308 | * memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); |
| 309 | * __entry->prev_pid = prev->pid; |
| 310 | * __entry->prev_prio = prev->prio; |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 311 | * memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
| 312 | * __entry->next_pid = next->pid; |
Steven Rostedt | ef18012 | 2009-03-10 14:10:56 -0400 | [diff] [blame] | 313 | * __entry->next_prio = next->prio; |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 314 | * ) |
| 315 | * |
| 316 | * * |
| 317 | * * Formatted output of a trace record via TP_printk(). |
| 318 | * * This is how the tracepoint will appear under ftrace |
| 319 | * * plugins that make use of this tracepoint. |
| 320 | * * |
| 321 | * * (raw-binary tracing wont actually perform this step.) |
| 322 | * * |
| 323 | * |
| 324 | * TP_printk("task %s:%d [%d] ==> %s:%d [%d]", |
| 325 | * __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, |
| 326 | * __entry->next_comm, __entry->next_pid, __entry->next_prio), |
| 327 | * |
| 328 | * ); |
| 329 | * |
| 330 | * This macro construct is thus used for the regular printk format |
| 331 | * tracing setup, it is used to construct a function pointer based |
| 332 | * tracepoint callback (this is used by programmatic plugins and |
| 333 | * can also by used by generic instrumentation like SystemTap), and |
| 334 | * it is also used to expose a structured trace record in |
GeunSik Lim | 156f5a7 | 2009-06-02 15:01:37 +0900 | [diff] [blame] | 335 | * /sys/kernel/debug/tracing/events/. |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 336 | * |
| 337 | * A set of (un)registration functions can be passed to the variant |
| 338 | * TRACE_EVENT_FN to perform any (un)registration work. |
Steven Rostedt | 823f912 | 2009-03-10 12:58:51 -0400 | [diff] [blame] | 339 | */ |
| 340 | |
Ingo Molnar | 091ad36 | 2009-11-26 09:04:55 +0100 | [diff] [blame] | 341 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) |
Steven Rostedt | ff038f5 | 2009-11-18 20:27:27 -0500 | [diff] [blame] | 342 | #define DEFINE_EVENT(template, name, proto, args) \ |
| 343 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
Steven Rostedt | e5bc972 | 2009-11-18 20:36:26 -0500 | [diff] [blame] | 344 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
| 345 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
Steven Rostedt | ff038f5 | 2009-11-18 20:27:27 -0500 | [diff] [blame] | 346 | |
Steven Rostedt | 30a8fec | 2009-03-10 12:41:38 -0400 | [diff] [blame] | 347 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
Steven Rostedt | da4d030 | 2009-03-09 17:14:30 -0400 | [diff] [blame] | 348 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 349 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
| 350 | assign, print, reg, unreg) \ |
| 351 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
Steven Rostedt | 7cb2e3e | 2009-08-26 00:32:37 -0400 | [diff] [blame] | 352 | |
| 353 | #endif /* ifdef TRACE_EVENT (see note above) */ |