blob: 03f9a4c165caa9a427fb05572ff3d3e585b892fa [file] [log] [blame]
Steven Rostedt33b0c222009-03-05 11:45:43 -05001/*
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 Rostedt770cb242009-03-05 21:35:29 -050043static int \
Steven Rostedt33b0c222009-03-05 11:45:43 -050044ftrace_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