Steven Rostedt | 33b0c22 | 2009-03-05 11:45:43 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Setup the showing format of trace point. |
| 3 | * |
| 4 | * int |
| 5 | * ftrace_format_##call(struct trace_seq *s) |
| 6 | * { |
| 7 | * struct ftrace_raw_##call field; |
| 8 | * int ret; |
| 9 | * |
| 10 | * ret = trace_seq_printf(s, #type " " #item ";" |
| 11 | * " size:%d; offset:%d;\n", |
| 12 | * sizeof(field.type), |
| 13 | * offsetof(struct ftrace_raw_##call, |
| 14 | * item)); |
| 15 | * |
| 16 | * } |
| 17 | */ |
| 18 | |
| 19 | #undef TRACE_STRUCT |
| 20 | #define TRACE_STRUCT(args...) args |
| 21 | |
| 22 | #undef TRACE_FIELD |
| 23 | #define TRACE_FIELD(type, item, assign) \ |
| 24 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ |
| 25 | "offset:%lu;\tsize:%lu;\n", \ |
| 26 | offsetof(typeof(field), item), \ |
| 27 | sizeof(field.item)); \ |
| 28 | if (!ret) \ |
| 29 | return 0; |
| 30 | |
| 31 | |
| 32 | #undef TRACE_FIELD_SPECIAL |
| 33 | #define TRACE_FIELD_SPECIAL(type_item, item, cmd) \ |
| 34 | ret = trace_seq_printf(s, "\tfield special:" #type_item ";\t" \ |
| 35 | "offset:%lu;\tsize:%lu;\n", \ |
| 36 | offsetof(typeof(field), item), \ |
| 37 | sizeof(field.item)); \ |
| 38 | if (!ret) \ |
| 39 | return 0; |
| 40 | |
| 41 | #undef TRACE_EVENT_FORMAT |
| 42 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ |
Steven Rostedt | 770cb24 | 2009-03-05 21:35:29 -0500 | [diff] [blame] | 43 | static int \ |
Steven Rostedt | 33b0c22 | 2009-03-05 11:45:43 -0500 | [diff] [blame] | 44 | ftrace_format_##call(struct trace_seq *s) \ |
| 45 | { \ |
| 46 | struct ftrace_raw_##call field; \ |
| 47 | int ret; \ |
| 48 | \ |
| 49 | tstruct; \ |
| 50 | \ |
| 51 | trace_seq_printf(s, "\nprint fmt: \"%s\"\n", tpfmt); \ |
| 52 | \ |
| 53 | return ret; \ |
| 54 | } |
| 55 | |