Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Stage 1 of the trace events. |
| 3 | * |
| 4 | * Override the macros in <trace/trace_events.h> to include the following: |
| 5 | * |
| 6 | * struct ftrace_raw_<call> { |
| 7 | * struct trace_entry ent; |
| 8 | * <type> <item>; |
| 9 | * <type2> <item2>[<len>]; |
| 10 | * [...] |
| 11 | * }; |
| 12 | * |
| 13 | * The <type> <item> is created by the __field(type, item) macro or |
| 14 | * the __array(type2, item2, len) macro. |
| 15 | * We simply do "type item;", and that will create the fields |
| 16 | * in the structure. |
| 17 | */ |
| 18 | |
| 19 | #include <linux/ftrace_event.h> |
| 20 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 21 | #undef __field |
| 22 | #define __field(type, item) type item; |
| 23 | |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 24 | #undef __field_ext |
| 25 | #define __field_ext(type, item, filter_type) type item; |
| 26 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 27 | #undef __array |
| 28 | #define __array(type, item, len) type item[len]; |
| 29 | |
| 30 | #undef __dynamic_array |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 31 | #define __dynamic_array(type, item, len) u32 __data_loc_##item; |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 32 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 33 | #undef __string |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 34 | #define __string(item, src) __dynamic_array(char, item, -1) |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 35 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 36 | #undef TP_STRUCT__entry |
| 37 | #define TP_STRUCT__entry(args...) args |
| 38 | |
| 39 | #undef TRACE_EVENT |
| 40 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ |
| 41 | struct ftrace_raw_##name { \ |
| 42 | struct trace_entry ent; \ |
| 43 | tstruct \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 44 | char __data[0]; \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 45 | }; \ |
| 46 | static struct ftrace_event_call event_##name |
| 47 | |
Josh Stone | 9741987 | 2009-08-24 14:43:13 -0700 | [diff] [blame] | 48 | /* Callbacks are meaningless to ftrace. */ |
| 49 | #undef TRACE_EVENT_FN |
| 50 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ |
| 51 | assign, print, reg, unreg) \ |
| 52 | TRACE_EVENT(name, TP_PROTO(proto), TP_ARGS(args), \ |
| 53 | TP_STRUCT__entry(tstruct), \ |
| 54 | TP_fast_assign(assign), \ |
| 55 | TP_printk(print)) |
| 56 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 57 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 58 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 59 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 60 | /* |
| 61 | * Stage 2 of the trace events. |
| 62 | * |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 63 | * Include the following: |
| 64 | * |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 65 | * struct ftrace_data_offsets_<call> { |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 66 | * u32 <item1>; |
| 67 | * u32 <item2>; |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 68 | * [...] |
| 69 | * }; |
| 70 | * |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 71 | * The __dynamic_array() macro will create each u32 <item>, this is |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 72 | * to keep the offset of each array from the beginning of the event. |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 73 | * The size of an array is also encoded, in the higher 16 bits of <item>. |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 74 | */ |
| 75 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 76 | #undef __field |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 77 | #define __field(type, item) |
| 78 | |
| 79 | #undef __field_ext |
| 80 | #define __field_ext(type, item, filter_type) |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 81 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 82 | #undef __array |
| 83 | #define __array(type, item, len) |
| 84 | |
| 85 | #undef __dynamic_array |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 86 | #define __dynamic_array(type, item, len) u32 item; |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 87 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 88 | #undef __string |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 89 | #define __string(item, src) __dynamic_array(char, item, -1) |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 90 | |
| 91 | #undef TRACE_EVENT |
| 92 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 93 | struct ftrace_data_offsets_##call { \ |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 94 | tstruct; \ |
| 95 | }; |
| 96 | |
| 97 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 98 | |
| 99 | /* |
Steven Rostedt | 6ff9a64 | 2009-06-10 14:28:34 -0400 | [diff] [blame] | 100 | * Setup the showing format of trace point. |
| 101 | * |
| 102 | * int |
| 103 | * ftrace_format_##call(struct trace_seq *s) |
| 104 | * { |
| 105 | * struct ftrace_raw_##call field; |
| 106 | * int ret; |
| 107 | * |
| 108 | * ret = trace_seq_printf(s, #type " " #item ";" |
| 109 | * " offset:%u; size:%u;\n", |
| 110 | * offsetof(struct ftrace_raw_##call, item), |
| 111 | * sizeof(field.type)); |
| 112 | * |
| 113 | * } |
| 114 | */ |
| 115 | |
| 116 | #undef TP_STRUCT__entry |
| 117 | #define TP_STRUCT__entry(args...) args |
| 118 | |
| 119 | #undef __field |
| 120 | #define __field(type, item) \ |
| 121 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ |
| 122 | "offset:%u;\tsize:%u;\n", \ |
| 123 | (unsigned int)offsetof(typeof(field), item), \ |
| 124 | (unsigned int)sizeof(field.item)); \ |
| 125 | if (!ret) \ |
| 126 | return 0; |
| 127 | |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 128 | #undef __field_ext |
| 129 | #define __field_ext(type, item, filter_type) __field(type, item) |
| 130 | |
Steven Rostedt | 6ff9a64 | 2009-06-10 14:28:34 -0400 | [diff] [blame] | 131 | #undef __array |
| 132 | #define __array(type, item, len) \ |
| 133 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ |
| 134 | "offset:%u;\tsize:%u;\n", \ |
| 135 | (unsigned int)offsetof(typeof(field), item), \ |
| 136 | (unsigned int)sizeof(field.item)); \ |
| 137 | if (!ret) \ |
| 138 | return 0; |
| 139 | |
| 140 | #undef __dynamic_array |
| 141 | #define __dynamic_array(type, item, len) \ |
Lai Jiangshan | 68fd60a | 2009-07-16 10:53:34 +0800 | [diff] [blame] | 142 | ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ |
Steven Rostedt | 6ff9a64 | 2009-06-10 14:28:34 -0400 | [diff] [blame] | 143 | "offset:%u;\tsize:%u;\n", \ |
| 144 | (unsigned int)offsetof(typeof(field), \ |
| 145 | __data_loc_##item), \ |
| 146 | (unsigned int)sizeof(field.__data_loc_##item)); \ |
| 147 | if (!ret) \ |
| 148 | return 0; |
| 149 | |
| 150 | #undef __string |
| 151 | #define __string(item, src) __dynamic_array(char, item, -1) |
| 152 | |
| 153 | #undef __entry |
| 154 | #define __entry REC |
| 155 | |
| 156 | #undef __print_symbolic |
| 157 | #undef __get_dynamic_array |
| 158 | #undef __get_str |
| 159 | |
| 160 | #undef TP_printk |
| 161 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) |
| 162 | |
| 163 | #undef TP_fast_assign |
| 164 | #define TP_fast_assign(args...) args |
| 165 | |
Peter Zijlstra | 3a65930 | 2009-07-21 17:34:57 +0200 | [diff] [blame] | 166 | #undef TP_perf_assign |
| 167 | #define TP_perf_assign(args...) |
| 168 | |
Steven Rostedt | 6ff9a64 | 2009-06-10 14:28:34 -0400 | [diff] [blame] | 169 | #undef TRACE_EVENT |
| 170 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ |
| 171 | static int \ |
Frederic Weisbecker | e8f9f4d | 2009-08-11 17:42:52 +0200 | [diff] [blame] | 172 | ftrace_format_##call(struct ftrace_event_call *unused, \ |
| 173 | struct trace_seq *s) \ |
Steven Rostedt | 6ff9a64 | 2009-06-10 14:28:34 -0400 | [diff] [blame] | 174 | { \ |
| 175 | struct ftrace_raw_##call field __attribute__((unused)); \ |
| 176 | int ret = 0; \ |
| 177 | \ |
| 178 | tstruct; \ |
| 179 | \ |
| 180 | trace_seq_printf(s, "\nprint fmt: " print); \ |
| 181 | \ |
| 182 | return ret; \ |
| 183 | } |
| 184 | |
| 185 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 186 | |
| 187 | /* |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 188 | * Stage 3 of the trace events. |
| 189 | * |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 190 | * Override the macros in <trace/trace_events.h> to include the following: |
| 191 | * |
| 192 | * enum print_line_t |
| 193 | * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags) |
| 194 | * { |
| 195 | * struct trace_seq *s = &iter->seq; |
| 196 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 |
| 197 | * struct trace_entry *entry; |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 198 | * struct trace_seq *p; |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 199 | * int ret; |
| 200 | * |
| 201 | * entry = iter->ent; |
| 202 | * |
| 203 | * if (entry->type != event_<call>.id) { |
| 204 | * WARN_ON_ONCE(1); |
| 205 | * return TRACE_TYPE_UNHANDLED; |
| 206 | * } |
| 207 | * |
| 208 | * field = (typeof(field))entry; |
| 209 | * |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 210 | * p = get_cpu_var(ftrace_event_seq); |
Steven Whitehouse | 56d8bd3 | 2009-06-03 14:52:03 +0100 | [diff] [blame] | 211 | * trace_seq_init(p); |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 212 | * ret = trace_seq_printf(s, <TP_printk> "\n"); |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 213 | * put_cpu(); |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 214 | * if (!ret) |
| 215 | * return TRACE_TYPE_PARTIAL_LINE; |
| 216 | * |
| 217 | * return TRACE_TYPE_HANDLED; |
| 218 | * } |
| 219 | * |
| 220 | * This is the method used to print the raw event to the trace |
| 221 | * output format. Note, this is not needed if the data is read |
| 222 | * in binary. |
| 223 | */ |
| 224 | |
| 225 | #undef __entry |
| 226 | #define __entry field |
| 227 | |
| 228 | #undef TP_printk |
| 229 | #define TP_printk(fmt, args...) fmt "\n", args |
| 230 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 231 | #undef __get_dynamic_array |
| 232 | #define __get_dynamic_array(field) \ |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 233 | ((void *)__entry + (__entry->__data_loc_##field & 0xffff)) |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 234 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 235 | #undef __get_str |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 236 | #define __get_str(field) (char *)__get_dynamic_array(field) |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 237 | |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 238 | #undef __print_flags |
| 239 | #define __print_flags(flag, delim, flag_array...) \ |
| 240 | ({ \ |
| 241 | static const struct trace_print_flags flags[] = \ |
| 242 | { flag_array, { -1, NULL }}; \ |
| 243 | ftrace_print_flags_seq(p, delim, flag, flags); \ |
| 244 | }) |
| 245 | |
Steven Rostedt | 0f4fc29 | 2009-05-20 19:21:47 -0400 | [diff] [blame] | 246 | #undef __print_symbolic |
| 247 | #define __print_symbolic(value, symbol_array...) \ |
| 248 | ({ \ |
| 249 | static const struct trace_print_flags symbols[] = \ |
| 250 | { symbol_array, { -1, NULL }}; \ |
| 251 | ftrace_print_symbols_seq(p, value, symbols); \ |
| 252 | }) |
| 253 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 254 | #undef TRACE_EVENT |
| 255 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
| 256 | enum print_line_t \ |
| 257 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ |
| 258 | { \ |
| 259 | struct trace_seq *s = &iter->seq; \ |
| 260 | struct ftrace_raw_##call *field; \ |
| 261 | struct trace_entry *entry; \ |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 262 | struct trace_seq *p; \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 263 | int ret; \ |
| 264 | \ |
| 265 | entry = iter->ent; \ |
| 266 | \ |
| 267 | if (entry->type != event_##call.id) { \ |
| 268 | WARN_ON_ONCE(1); \ |
| 269 | return TRACE_TYPE_UNHANDLED; \ |
| 270 | } \ |
| 271 | \ |
| 272 | field = (typeof(field))entry; \ |
| 273 | \ |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 274 | p = &get_cpu_var(ftrace_event_seq); \ |
Steven Whitehouse | 56d8bd3 | 2009-06-03 14:52:03 +0100 | [diff] [blame] | 275 | trace_seq_init(p); \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 276 | ret = trace_seq_printf(s, #call ": " print); \ |
Steven Rostedt | be74b73 | 2009-05-26 20:25:22 +0200 | [diff] [blame] | 277 | put_cpu(); \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 278 | if (!ret) \ |
| 279 | return TRACE_TYPE_PARTIAL_LINE; \ |
| 280 | \ |
| 281 | return TRACE_TYPE_HANDLED; \ |
| 282 | } |
| 283 | |
| 284 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 285 | |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 286 | #undef __field_ext |
| 287 | #define __field_ext(type, item, filter_type) \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 288 | ret = trace_define_field(event_call, #type, #item, \ |
| 289 | offsetof(typeof(field), item), \ |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 290 | sizeof(field.item), \ |
| 291 | is_signed_type(type), filter_type); \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 292 | if (ret) \ |
| 293 | return ret; |
| 294 | |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 295 | #undef __field |
| 296 | #define __field(type, item) __field_ext(type, item, FILTER_OTHER) |
| 297 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 298 | #undef __array |
| 299 | #define __array(type, item, len) \ |
| 300 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
| 301 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
| 302 | offsetof(typeof(field), item), \ |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 303 | sizeof(field.item), 0, FILTER_OTHER); \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 304 | if (ret) \ |
| 305 | return ret; |
| 306 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 307 | #undef __dynamic_array |
| 308 | #define __dynamic_array(type, item, len) \ |
Lai Jiangshan | 68fd60a | 2009-07-16 10:53:34 +0800 | [diff] [blame] | 309 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 310 | offsetof(typeof(field), __data_loc_##item), \ |
| 311 | sizeof(field.__data_loc_##item), 0, \ |
| 312 | FILTER_OTHER); |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 313 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 314 | #undef __string |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 315 | #define __string(item, src) __dynamic_array(char, item, -1) |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 316 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 317 | #undef TRACE_EVENT |
| 318 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ |
| 319 | int \ |
Li Zefan | 14be96c | 2009-08-19 15:53:52 +0800 | [diff] [blame] | 320 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 321 | { \ |
| 322 | struct ftrace_raw_##call field; \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 323 | int ret; \ |
| 324 | \ |
Li Zefan | e647d6b | 2009-08-19 15:54:32 +0800 | [diff] [blame] | 325 | ret = trace_define_common_fields(event_call); \ |
| 326 | if (ret) \ |
| 327 | return ret; \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 328 | \ |
| 329 | tstruct; \ |
| 330 | \ |
| 331 | return ret; \ |
| 332 | } |
| 333 | |
| 334 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 335 | |
| 336 | /* |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 337 | * remember the offset of each array from the beginning of the event. |
| 338 | */ |
| 339 | |
| 340 | #undef __entry |
| 341 | #define __entry entry |
| 342 | |
| 343 | #undef __field |
| 344 | #define __field(type, item) |
| 345 | |
Li Zefan | 43b51ea | 2009-08-07 10:33:22 +0800 | [diff] [blame] | 346 | #undef __field_ext |
| 347 | #define __field_ext(type, item, filter_type) |
| 348 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 349 | #undef __array |
| 350 | #define __array(type, item, len) |
| 351 | |
| 352 | #undef __dynamic_array |
| 353 | #define __dynamic_array(type, item, len) \ |
| 354 | __data_offsets->item = __data_size + \ |
| 355 | offsetof(typeof(*entry), __data); \ |
Li Zefan | 7d536cb | 2009-07-16 10:54:02 +0800 | [diff] [blame] | 356 | __data_offsets->item |= (len * sizeof(type)) << 16; \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 357 | __data_size += (len) * sizeof(type); |
| 358 | |
| 359 | #undef __string |
| 360 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \ |
| 361 | |
| 362 | #undef TRACE_EVENT |
| 363 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
| 364 | static inline int ftrace_get_offsets_##call( \ |
| 365 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ |
| 366 | { \ |
| 367 | int __data_size = 0; \ |
| 368 | struct ftrace_raw_##call __maybe_unused *entry; \ |
| 369 | \ |
| 370 | tstruct; \ |
| 371 | \ |
| 372 | return __data_size; \ |
| 373 | } |
| 374 | |
| 375 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 376 | |
Peter Zijlstra | 3a65930 | 2009-07-21 17:34:57 +0200 | [diff] [blame] | 377 | #ifdef CONFIG_EVENT_PROFILE |
| 378 | |
| 379 | /* |
| 380 | * Generate the functions needed for tracepoint perf_counter support. |
| 381 | * |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 382 | * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later |
Peter Zijlstra | 3a65930 | 2009-07-21 17:34:57 +0200 | [diff] [blame] | 383 | * |
| 384 | * static int ftrace_profile_enable_<call>(struct ftrace_event_call *event_call) |
| 385 | * { |
| 386 | * int ret = 0; |
| 387 | * |
| 388 | * if (!atomic_inc_return(&event_call->profile_count)) |
| 389 | * ret = register_trace_<call>(ftrace_profile_<call>); |
| 390 | * |
| 391 | * return ret; |
| 392 | * } |
| 393 | * |
| 394 | * static void ftrace_profile_disable_<call>(struct ftrace_event_call *event_call) |
| 395 | * { |
| 396 | * if (atomic_add_negative(-1, &event->call->profile_count)) |
| 397 | * unregister_trace_<call>(ftrace_profile_<call>); |
| 398 | * } |
| 399 | * |
| 400 | */ |
| 401 | |
Peter Zijlstra | 3a65930 | 2009-07-21 17:34:57 +0200 | [diff] [blame] | 402 | #undef TRACE_EVENT |
| 403 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
| 404 | \ |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 405 | static void ftrace_profile_##call(proto); \ |
Peter Zijlstra | 3a65930 | 2009-07-21 17:34:57 +0200 | [diff] [blame] | 406 | \ |
| 407 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ |
| 408 | { \ |
| 409 | int ret = 0; \ |
| 410 | \ |
| 411 | if (!atomic_inc_return(&event_call->profile_count)) \ |
| 412 | ret = register_trace_##call(ftrace_profile_##call); \ |
| 413 | \ |
| 414 | return ret; \ |
| 415 | } \ |
| 416 | \ |
| 417 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ |
| 418 | { \ |
| 419 | if (atomic_add_negative(-1, &event_call->profile_count)) \ |
| 420 | unregister_trace_##call(ftrace_profile_##call); \ |
| 421 | } |
| 422 | |
| 423 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 424 | |
Peter Zijlstra | 3a65930 | 2009-07-21 17:34:57 +0200 | [diff] [blame] | 425 | #endif |
| 426 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 427 | /* |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 428 | * Stage 4 of the trace events. |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 429 | * |
| 430 | * Override the macros in <trace/trace_events.h> to include the following: |
| 431 | * |
| 432 | * static void ftrace_event_<call>(proto) |
| 433 | * { |
| 434 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); |
| 435 | * } |
| 436 | * |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 437 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 438 | * { |
| 439 | * int ret; |
| 440 | * |
| 441 | * ret = register_trace_<call>(ftrace_event_<call>); |
| 442 | * if (!ret) |
| 443 | * pr_info("event trace: Could not activate trace point " |
| 444 | * "probe to <call>"); |
| 445 | * return ret; |
| 446 | * } |
| 447 | * |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 448 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 449 | * { |
| 450 | * unregister_trace_<call>(ftrace_event_<call>); |
| 451 | * } |
| 452 | * |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 453 | * |
| 454 | * For those macros defined with TRACE_EVENT: |
| 455 | * |
| 456 | * static struct ftrace_event_call event_<call>; |
| 457 | * |
| 458 | * static void ftrace_raw_event_<call>(proto) |
| 459 | * { |
| 460 | * struct ring_buffer_event *event; |
| 461 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
| 462 | * unsigned long irq_flags; |
| 463 | * int pc; |
| 464 | * |
| 465 | * local_save_flags(irq_flags); |
| 466 | * pc = preempt_count(); |
| 467 | * |
| 468 | * event = trace_current_buffer_lock_reserve(event_<call>.id, |
| 469 | * sizeof(struct ftrace_raw_<call>), |
| 470 | * irq_flags, pc); |
| 471 | * if (!event) |
| 472 | * return; |
| 473 | * entry = ring_buffer_event_data(event); |
| 474 | * |
| 475 | * <assign>; <-- Here we assign the entries by the __field and |
| 476 | * __array macros. |
| 477 | * |
| 478 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); |
| 479 | * } |
| 480 | * |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 481 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 482 | * { |
| 483 | * int ret; |
| 484 | * |
| 485 | * ret = register_trace_<call>(ftrace_raw_event_<call>); |
| 486 | * if (!ret) |
| 487 | * pr_info("event trace: Could not activate trace point " |
| 488 | * "probe to <call>"); |
| 489 | * return ret; |
| 490 | * } |
| 491 | * |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 492 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 493 | * { |
| 494 | * unregister_trace_<call>(ftrace_raw_event_<call>); |
| 495 | * } |
| 496 | * |
| 497 | * static struct trace_event ftrace_event_type_<call> = { |
| 498 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
| 499 | * }; |
| 500 | * |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 501 | * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused) |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 502 | * { |
| 503 | * int id; |
| 504 | * |
| 505 | * id = register_ftrace_event(&ftrace_event_type_<call>); |
| 506 | * if (!id) |
| 507 | * return -ENODEV; |
| 508 | * event_<call>.id = id; |
| 509 | * return 0; |
| 510 | * } |
| 511 | * |
| 512 | * static struct ftrace_event_call __used |
| 513 | * __attribute__((__aligned__(4))) |
| 514 | * __attribute__((section("_ftrace_events"))) event_<call> = { |
| 515 | * .name = "<call>", |
| 516 | * .system = "<system>", |
| 517 | * .raw_init = ftrace_raw_init_event_<call>, |
| 518 | * .regfunc = ftrace_reg_event_<call>, |
| 519 | * .unregfunc = ftrace_unreg_event_<call>, |
| 520 | * .show_format = ftrace_format_<call>, |
| 521 | * } |
| 522 | * |
| 523 | */ |
| 524 | |
| 525 | #undef TP_FMT |
| 526 | #define TP_FMT(fmt, args...) fmt "\n", ##args |
| 527 | |
| 528 | #ifdef CONFIG_EVENT_PROFILE |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 529 | |
| 530 | #define _TRACE_PROFILE_INIT(call) \ |
| 531 | .profile_count = ATOMIC_INIT(-1), \ |
| 532 | .profile_enable = ftrace_profile_enable_##call, \ |
| 533 | .profile_disable = ftrace_profile_disable_##call, |
| 534 | |
| 535 | #else |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 536 | #define _TRACE_PROFILE_INIT(call) |
| 537 | #endif |
| 538 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 539 | #undef __entry |
| 540 | #define __entry entry |
| 541 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 542 | #undef __field |
| 543 | #define __field(type, item) |
| 544 | |
| 545 | #undef __array |
| 546 | #define __array(type, item, len) |
| 547 | |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 548 | #undef __dynamic_array |
| 549 | #define __dynamic_array(type, item, len) \ |
| 550 | __entry->__data_loc_##item = __data_offsets.item; |
| 551 | |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 552 | #undef __string |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 553 | #define __string(item, src) __dynamic_array(char, item, -1) \ |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 554 | |
| 555 | #undef __assign_str |
| 556 | #define __assign_str(dst, src) \ |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 557 | strcpy(__get_str(dst), src); |
| 558 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 559 | #undef TRACE_EVENT |
| 560 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 561 | \ |
| 562 | static struct ftrace_event_call event_##call; \ |
| 563 | \ |
| 564 | static void ftrace_raw_event_##call(proto) \ |
| 565 | { \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 566 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
Zhaolei | f2aebae | 2009-05-27 21:36:02 +0800 | [diff] [blame] | 567 | struct ftrace_event_call *event_call = &event_##call; \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 568 | struct ring_buffer_event *event; \ |
| 569 | struct ftrace_raw_##call *entry; \ |
| 570 | unsigned long irq_flags; \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 571 | int __data_size; \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 572 | int pc; \ |
| 573 | \ |
| 574 | local_save_flags(irq_flags); \ |
| 575 | pc = preempt_count(); \ |
| 576 | \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 577 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 578 | \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 579 | event = trace_current_buffer_lock_reserve(event_##call.id, \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 580 | sizeof(*entry) + __data_size, \ |
Frederic Weisbecker | 9cbf117 | 2009-04-19 04:51:29 +0200 | [diff] [blame] | 581 | irq_flags, pc); \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 582 | if (!event) \ |
| 583 | return; \ |
| 584 | entry = ring_buffer_event_data(event); \ |
| 585 | \ |
Li Zefan | 7fcb7c4 | 2009-06-01 15:35:46 +0800 | [diff] [blame] | 586 | \ |
| 587 | tstruct \ |
| 588 | \ |
Li Zefan | a9c1c3a | 2009-06-01 15:35:13 +0800 | [diff] [blame] | 589 | { assign; } \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 590 | \ |
Zhaolei | f2aebae | 2009-05-27 21:36:02 +0800 | [diff] [blame] | 591 | if (!filter_current_check_discard(event_call, entry, event)) \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 592 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ |
| 593 | } \ |
| 594 | \ |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 595 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 596 | { \ |
| 597 | int ret; \ |
| 598 | \ |
| 599 | ret = register_trace_##call(ftrace_raw_event_##call); \ |
| 600 | if (ret) \ |
| 601 | pr_info("event trace: Could not activate trace point " \ |
| 602 | "probe to " #call "\n"); \ |
| 603 | return ret; \ |
| 604 | } \ |
| 605 | \ |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 606 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 607 | { \ |
| 608 | unregister_trace_##call(ftrace_raw_event_##call); \ |
| 609 | } \ |
| 610 | \ |
| 611 | static struct trace_event ftrace_event_type_##call = { \ |
| 612 | .trace = ftrace_raw_output_##call, \ |
| 613 | }; \ |
| 614 | \ |
Masami Hiramatsu | bd1a5c8 | 2009-08-13 16:34:53 -0400 | [diff] [blame^] | 615 | static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 616 | { \ |
| 617 | int id; \ |
| 618 | \ |
| 619 | id = register_ftrace_event(&ftrace_event_type_##call); \ |
| 620 | if (!id) \ |
| 621 | return -ENODEV; \ |
| 622 | event_##call.id = id; \ |
| 623 | INIT_LIST_HEAD(&event_##call.fields); \ |
| 624 | init_preds(&event_##call); \ |
| 625 | return 0; \ |
| 626 | } \ |
| 627 | \ |
| 628 | static struct ftrace_event_call __used \ |
| 629 | __attribute__((__aligned__(4))) \ |
| 630 | __attribute__((section("_ftrace_events"))) event_##call = { \ |
| 631 | .name = #call, \ |
| 632 | .system = __stringify(TRACE_SYSTEM), \ |
Steven Rostedt | 6d72373 | 2009-04-10 14:53:50 -0400 | [diff] [blame] | 633 | .event = &ftrace_event_type_##call, \ |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 634 | .raw_init = ftrace_raw_init_event_##call, \ |
| 635 | .regfunc = ftrace_raw_reg_event_##call, \ |
| 636 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
| 637 | .show_format = ftrace_format_##call, \ |
| 638 | .define_fields = ftrace_define_fields_##call, \ |
| 639 | _TRACE_PROFILE_INIT(call) \ |
| 640 | } |
| 641 | |
| 642 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 643 | |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 644 | /* |
| 645 | * Define the insertion callback to profile events |
| 646 | * |
| 647 | * The job is very similar to ftrace_raw_event_<call> except that we don't |
| 648 | * insert in the ring buffer but in a perf counter. |
| 649 | * |
| 650 | * static void ftrace_profile_<call>(proto) |
| 651 | * { |
| 652 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; |
| 653 | * struct ftrace_event_call *event_call = &event_<call>; |
| 654 | * extern void perf_tpcounter_event(int, u64, u64, void *, int); |
| 655 | * struct ftrace_raw_##call *entry; |
| 656 | * u64 __addr = 0, __count = 1; |
| 657 | * unsigned long irq_flags; |
| 658 | * int __entry_size; |
| 659 | * int __data_size; |
| 660 | * int pc; |
| 661 | * |
| 662 | * local_save_flags(irq_flags); |
| 663 | * pc = preempt_count(); |
| 664 | * |
| 665 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); |
Frederic Weisbecker | 304703a | 2009-08-10 16:11:32 +0200 | [diff] [blame] | 666 | * |
| 667 | * // Below we want to get the aligned size by taking into account |
| 668 | * // the u32 field that will later store the buffer size |
| 669 | * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32), |
| 670 | * sizeof(u64)); |
| 671 | * __entry_size -= sizeof(u32); |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 672 | * |
| 673 | * do { |
| 674 | * char raw_data[__entry_size]; <- allocate our sample in the stack |
| 675 | * struct trace_entry *ent; |
| 676 | * |
Frederic Weisbecker | 1853db0 | 2009-08-10 16:38:36 +0200 | [diff] [blame] | 677 | * zero dead bytes from alignment to avoid stack leak to userspace: |
| 678 | * |
| 679 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 680 | * entry = (struct ftrace_raw_<call> *)raw_data; |
| 681 | * ent = &entry->ent; |
| 682 | * tracing_generic_entry_update(ent, irq_flags, pc); |
| 683 | * ent->type = event_call->id; |
| 684 | * |
| 685 | * <tstruct> <- do some jobs with dynamic arrays |
| 686 | * |
| 687 | * <assign> <- affect our values |
| 688 | * |
| 689 | * perf_tpcounter_event(event_call->id, __addr, __count, entry, |
| 690 | * __entry_size); <- submit them to perf counter |
| 691 | * } while (0); |
| 692 | * |
| 693 | * } |
| 694 | */ |
| 695 | |
| 696 | #ifdef CONFIG_EVENT_PROFILE |
| 697 | |
| 698 | #undef __perf_addr |
| 699 | #define __perf_addr(a) __addr = (a) |
| 700 | |
| 701 | #undef __perf_count |
| 702 | #define __perf_count(c) __count = (c) |
| 703 | |
| 704 | #undef TRACE_EVENT |
| 705 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
| 706 | static void ftrace_profile_##call(proto) \ |
| 707 | { \ |
| 708 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
| 709 | struct ftrace_event_call *event_call = &event_##call; \ |
| 710 | extern void perf_tpcounter_event(int, u64, u64, void *, int); \ |
| 711 | struct ftrace_raw_##call *entry; \ |
| 712 | u64 __addr = 0, __count = 1; \ |
| 713 | unsigned long irq_flags; \ |
| 714 | int __entry_size; \ |
| 715 | int __data_size; \ |
| 716 | int pc; \ |
| 717 | \ |
| 718 | local_save_flags(irq_flags); \ |
| 719 | pc = preempt_count(); \ |
| 720 | \ |
| 721 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
Peter Zijlstra | a044560 | 2009-08-10 11:16:52 +0200 | [diff] [blame] | 722 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ |
| 723 | sizeof(u64)); \ |
Frederic Weisbecker | 304703a | 2009-08-10 16:11:32 +0200 | [diff] [blame] | 724 | __entry_size -= sizeof(u32); \ |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 725 | \ |
| 726 | do { \ |
| 727 | char raw_data[__entry_size]; \ |
| 728 | struct trace_entry *ent; \ |
| 729 | \ |
Frederic Weisbecker | 1853db0 | 2009-08-10 16:38:36 +0200 | [diff] [blame] | 730 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ |
Frederic Weisbecker | f413cdb | 2009-08-07 01:25:54 +0200 | [diff] [blame] | 731 | entry = (struct ftrace_raw_##call *)raw_data; \ |
| 732 | ent = &entry->ent; \ |
| 733 | tracing_generic_entry_update(ent, irq_flags, pc); \ |
| 734 | ent->type = event_call->id; \ |
| 735 | \ |
| 736 | tstruct \ |
| 737 | \ |
| 738 | { assign; } \ |
| 739 | \ |
| 740 | perf_tpcounter_event(event_call->id, __addr, __count, entry,\ |
| 741 | __entry_size); \ |
| 742 | } while (0); \ |
| 743 | \ |
| 744 | } |
| 745 | |
| 746 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 747 | #endif /* CONFIG_EVENT_PROFILE */ |
| 748 | |
Steven Rostedt | f42c85e | 2009-04-13 12:25:37 -0400 | [diff] [blame] | 749 | #undef _TRACE_PROFILE_INIT |
| 750 | |