|
@@ -129,3 +129,48 @@ ftrace_format_##call(struct trace_seq *s) \
|
|
|
}
|
|
|
|
|
|
#include <trace/trace_event_types.h>
|
|
|
+
|
|
|
+#undef __field
|
|
|
+#define __field(type, item) \
|
|
|
+ ret = trace_define_field(event_call, #type, #item, \
|
|
|
+ offsetof(typeof(field), item), \
|
|
|
+ sizeof(field.item)); \
|
|
|
+ if (ret) \
|
|
|
+ return ret;
|
|
|
+
|
|
|
+#undef __array
|
|
|
+#define __array(type, item, len) \
|
|
|
+ ret = trace_define_field(event_call, #type "[" #len "]", #item, \
|
|
|
+ offsetof(typeof(field), item), \
|
|
|
+ sizeof(field.item)); \
|
|
|
+ if (ret) \
|
|
|
+ return ret;
|
|
|
+
|
|
|
+#define __common_field(type, item) \
|
|
|
+ ret = trace_define_field(event_call, #type, "common_" #item, \
|
|
|
+ offsetof(typeof(field.ent), item), \
|
|
|
+ sizeof(field.ent.item)); \
|
|
|
+ if (ret) \
|
|
|
+ return ret;
|
|
|
+
|
|
|
+#undef TRACE_EVENT
|
|
|
+#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
|
|
|
+int \
|
|
|
+ftrace_define_fields_##call(void) \
|
|
|
+{ \
|
|
|
+ struct ftrace_raw_##call field; \
|
|
|
+ struct ftrace_event_call *event_call = &event_##call; \
|
|
|
+ int ret; \
|
|
|
+ \
|
|
|
+ __common_field(unsigned char, type); \
|
|
|
+ __common_field(unsigned char, flags); \
|
|
|
+ __common_field(unsigned char, preempt_count); \
|
|
|
+ __common_field(int, pid); \
|
|
|
+ __common_field(int, tgid); \
|
|
|
+ \
|
|
|
+ tstruct; \
|
|
|
+ \
|
|
|
+ return ret; \
|
|
|
+}
|
|
|
+
|
|
|
+#include <trace/trace_event_types.h>
|