2 * Stage 2 of the trace events.
4 * Override the macros in <trace/trace_event_types.h> to include the following:
7 * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
9 * struct trace_seq *s = &iter->seq;
10 * struct ftrace_raw_<call> *field; <-- defined in stage 1
11 * struct trace_entry *entry;
16 * if (entry->type != event_<call>.id) {
18 * return TRACE_TYPE_UNHANDLED;
21 * field = (typeof(field))entry;
23 * ret = trace_seq_printf(s, <TPRAWFMT> "%s", <ARGS> "\n");
25 * return TRACE_TYPE_PARTIAL_LINE;
27 * return TRACE_TYPE_HANDLED;
30 * This is the method used to print the raw event to the trace
31 * output format. Note, this is not needed if the data is read
36 #define TRACE_STRUCT(args...) args
39 #define TRACE_FIELD(type, item, assign) \
42 #undef TRACE_FIELD_SPECIAL
43 #define TRACE_FIELD_SPECIAL(type_item, item, cmd) \
48 #define TPRAWFMT(args...) args
50 #undef TRACE_EVENT_FORMAT
51 #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
53 ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
55 struct trace_seq *s = &iter->seq; \
56 struct ftrace_raw_##call *field; \
57 struct trace_entry *entry; \
62 if (entry->type != event_##call.id) { \
64 return TRACE_TYPE_UNHANDLED; \
67 field = (typeof(field))entry; \
69 ret = trace_seq_printf(s, tpfmt "%s", tstruct "\n"); \
71 return TRACE_TYPE_PARTIAL_LINE; \
73 return TRACE_TYPE_HANDLED; \
76 #include <trace/trace_event_types.h>
79 * Setup the showing format of trace point.
82 * ftrace_format_##call(struct trace_seq *s)
84 * struct ftrace_raw_##call field;
87 * ret = trace_seq_printf(s, #type " " #item ";"
88 * " size:%d; offset:%d;\n",
90 * offsetof(struct ftrace_raw_##call,
97 #define TRACE_FIELD(type, item, assign) \
98 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
99 "offset:%lu;\tsize:%lu;\n", \
100 offsetof(typeof(field), item), \
101 sizeof(field.item)); \
106 #undef TRACE_FIELD_SPECIAL
107 #define TRACE_FIELD_SPECIAL(type_item, item, cmd) \
108 ret = trace_seq_printf(s, "\tfield special:" #type_item ";\t" \
109 "offset:%lu;\tsize:%lu;\n", \
110 offsetof(typeof(field), item), \
111 sizeof(field.item)); \
115 #undef TRACE_EVENT_FORMAT
116 #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
118 ftrace_format_##call(struct trace_seq *s) \
120 struct ftrace_raw_##call field; \
125 trace_seq_printf(s, "\nprint fmt: \"%s\"\n", tpfmt); \
130 #include <trace/trace_event_types.h>