aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-05 11:45:43 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-03-05 21:46:42 -0500
commit33b0c229e3abeae00493ed1d6f0b07191977a0a2 (patch)
treef11127408c678be82545f8c949f49f499c3b6f95 /kernel
parent5e2336a0d47c9661a40cc5ef85135ce1406af6e8 (diff)
tracing: move print of event format to separate file
Impact: clean up Move the macro that creates the event format file to a separate header. This will allow the default ftrace events to use this same macro to create the formats to read those events. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events_stage_2.h53
-rw-r--r--kernel/trace/trace_format.h55
2 files changed, 56 insertions, 52 deletions
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h
index b1cebba1d9b4..d24a97e74aea 100644
--- a/kernel/trace/trace_events_stage_2.h
+++ b/kernel/trace/trace_events_stage_2.h
@@ -75,56 +75,5 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
75 75
76#include <trace/trace_event_types.h> 76#include <trace/trace_event_types.h>
77 77
78/* 78#include "trace_format.h"
79 * Setup the showing format of trace point.
80 *
81 * int
82 * ftrace_format_##call(struct trace_seq *s)
83 * {
84 * struct ftrace_raw_##call field;
85 * int ret;
86 *
87 * ret = trace_seq_printf(s, #type " " #item ";"
88 * " size:%d; offset:%d;\n",
89 * sizeof(field.type),
90 * offsetof(struct ftrace_raw_##call,
91 * item));
92 *
93 * }
94 */
95
96#undef TRACE_FIELD
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)); \
102 if (!ret) \
103 return 0;
104
105
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)); \
112 if (!ret) \
113 return 0;
114
115#undef TRACE_EVENT_FORMAT
116#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
117int \
118ftrace_format_##call(struct trace_seq *s) \
119{ \
120 struct ftrace_raw_##call field; \
121 int ret; \
122 \
123 tstruct; \
124 \
125 trace_seq_printf(s, "\nprint fmt: \"%s\"\n", tpfmt); \
126 \
127 return ret; \
128}
129
130#include <trace/trace_event_types.h> 79#include <trace/trace_event_types.h>
diff --git a/kernel/trace/trace_format.h b/kernel/trace/trace_format.h
new file mode 100644
index 000000000000..53a6b1357116
--- /dev/null
+++ b/kernel/trace/trace_format.h
@@ -0,0 +1,55 @@
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) \
43int \
44ftrace_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