aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2009-12-15 02:39:57 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-06 12:08:46 -0500
commit0fa0edaf32b9a78b9854f1da98d4511a501089b0 (patch)
tree2226710ff7f455cfc9ed9e29252337f70cf3ab33
parent5a65e956220efc2421e21ee56d6153fd5c533a95 (diff)
tracing: Remove show_format and related macros from TRACE_EVENT
The previous patches added the use of print_fmt string and changes the trace_define_field() function to also create the fields and format output for the event format files. text data bss dec hex filename 5857201 1355780 9336808 16549789 fc879d vmlinux 5884589 1351684 9337896 16574169 fce6d9 vmlinux-orig The above shows the size of the vmlinux after this patch set compared to the vmlinux-orig which is before the patch set. This saves us 27k on text, 1k on bss and adds just 4k of data. The total savings of 24k in size. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> LKML-Reference: <4B273D4D.40604@cn.fujitsu.com> Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/ftrace_event.h2
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/trace/ftrace.h133
-rw-r--r--include/trace/syscall.h4
-rw-r--r--kernel/trace/trace_events.c12
-rw-r--r--kernel/trace/trace_export.c73
-rw-r--r--kernel/trace/trace_kprobe.c78
-rw-r--r--kernel/trace/trace_syscalls.c66
8 files changed, 6 insertions, 364 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index bd23d8e52f02..84a5629adfd8 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -123,8 +123,6 @@ struct ftrace_event_call {
123 int id; 123 int id;
124 const char *print_fmt; 124 const char *print_fmt;
125 int (*raw_init)(struct ftrace_event_call *); 125 int (*raw_init)(struct ftrace_event_call *);
126 int (*show_format)(struct ftrace_event_call *,
127 struct trace_seq *);
128 int (*define_fields)(struct ftrace_event_call *); 126 int (*define_fields)(struct ftrace_event_call *);
129 struct list_head fields; 127 struct list_head fields;
130 int filter_active; 128 int filter_active;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index ed353d274a77..7b219696ad24 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -144,7 +144,6 @@ struct perf_event_attr;
144 .system = "syscalls", \ 144 .system = "syscalls", \
145 .event = &enter_syscall_print_##sname, \ 145 .event = &enter_syscall_print_##sname, \
146 .raw_init = init_syscall_trace, \ 146 .raw_init = init_syscall_trace, \
147 .show_format = syscall_enter_format, \
148 .define_fields = syscall_enter_define_fields, \ 147 .define_fields = syscall_enter_define_fields, \
149 .regfunc = reg_event_syscall_enter, \ 148 .regfunc = reg_event_syscall_enter, \
150 .unregfunc = unreg_event_syscall_enter, \ 149 .unregfunc = unreg_event_syscall_enter, \
@@ -166,7 +165,6 @@ struct perf_event_attr;
166 .system = "syscalls", \ 165 .system = "syscalls", \
167 .event = &exit_syscall_print_##sname, \ 166 .event = &exit_syscall_print_##sname, \
168 .raw_init = init_syscall_trace, \ 167 .raw_init = init_syscall_trace, \
169 .show_format = syscall_exit_format, \
170 .define_fields = syscall_exit_define_fields, \ 168 .define_fields = syscall_exit_define_fields, \
171 .regfunc = reg_event_syscall_exit, \ 169 .regfunc = reg_event_syscall_exit, \
172 .unregfunc = unreg_event_syscall_exit, \ 170 .unregfunc = unreg_event_syscall_exit, \
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 3351d85c83a3..df65b99880b1 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -131,130 +131,6 @@
131#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 131#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
132 132
133/* 133/*
134 * Setup the showing format of trace point.
135 *
136 * int
137 * ftrace_format_##call(struct trace_seq *s)
138 * {
139 * struct ftrace_raw_##call field;
140 * int ret;
141 *
142 * ret = trace_seq_printf(s, #type " " #item ";"
143 * " offset:%u; size:%u;\n",
144 * offsetof(struct ftrace_raw_##call, item),
145 * sizeof(field.type));
146 *
147 * }
148 */
149
150#undef TP_STRUCT__entry
151#define TP_STRUCT__entry(args...) args
152
153#undef __field
154#define __field(type, item) \
155 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
156 "offset:%u;\tsize:%u;\tsigned:%u;\n", \
157 (unsigned int)offsetof(typeof(field), item), \
158 (unsigned int)sizeof(field.item), \
159 (unsigned int)is_signed_type(type)); \
160 if (!ret) \
161 return 0;
162
163#undef __field_ext
164#define __field_ext(type, item, filter_type) __field(type, item)
165
166#undef __array
167#define __array(type, item, len) \
168 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
169 "offset:%u;\tsize:%u;\tsigned:%u;\n", \
170 (unsigned int)offsetof(typeof(field), item), \
171 (unsigned int)sizeof(field.item), \
172 (unsigned int)is_signed_type(type)); \
173 if (!ret) \
174 return 0;
175
176#undef __dynamic_array
177#define __dynamic_array(type, item, len) \
178 ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\
179 "offset:%u;\tsize:%u;\tsigned:%u;\n", \
180 (unsigned int)offsetof(typeof(field), \
181 __data_loc_##item), \
182 (unsigned int)sizeof(field.__data_loc_##item), \
183 (unsigned int)is_signed_type(type)); \
184 if (!ret) \
185 return 0;
186
187#undef __string
188#define __string(item, src) __dynamic_array(char, item, -1)
189
190#undef __entry
191#define __entry REC
192
193#undef __print_symbolic
194#undef __get_dynamic_array
195#undef __get_str
196
197#undef TP_printk
198#define TP_printk(fmt, args...) "\"%s\", %s\n", fmt, __stringify(args)
199
200#undef TP_fast_assign
201#define TP_fast_assign(args...) args
202
203#undef TP_perf_assign
204#define TP_perf_assign(args...)
205
206#undef DECLARE_EVENT_CLASS
207#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
208static int \
209ftrace_format_setup_##call(struct ftrace_event_call *unused, \
210 struct trace_seq *s) \
211{ \
212 struct ftrace_raw_##call field __attribute__((unused)); \
213 int ret = 0; \
214 \
215 tstruct; \
216 \
217 return ret; \
218} \
219 \
220static int \
221ftrace_format_##call(struct ftrace_event_call *unused, \
222 struct trace_seq *s) \
223{ \
224 int ret = 0; \
225 \
226 ret = ftrace_format_setup_##call(unused, s); \
227 if (!ret) \
228 return ret; \
229 \
230 ret = trace_seq_printf(s, "\nprint fmt: " print); \
231 \
232 return ret; \
233}
234
235#undef DEFINE_EVENT
236#define DEFINE_EVENT(template, name, proto, args)
237
238#undef DEFINE_EVENT_PRINT
239#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
240static int \
241ftrace_format_##name(struct ftrace_event_call *unused, \
242 struct trace_seq *s) \
243{ \
244 int ret = 0; \
245 \
246 ret = ftrace_format_setup_##template(unused, s); \
247 if (!ret) \
248 return ret; \
249 \
250 trace_seq_printf(s, "\nprint fmt: " print); \
251 \
252 return ret; \
253}
254
255#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
256
257/*
258 * Stage 3 of the trace events. 134 * Stage 3 of the trace events.
259 * 135 *
260 * Override the macros in <trace/trace_events.h> to include the following: 136 * Override the macros in <trace/trace_events.h> to include the following:
@@ -622,7 +498,6 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
622 * .raw_init = trace_event_raw_init, 498 * .raw_init = trace_event_raw_init,
623 * .regfunc = ftrace_reg_event_<call>, 499 * .regfunc = ftrace_reg_event_<call>,
624 * .unregfunc = ftrace_unreg_event_<call>, 500 * .unregfunc = ftrace_unreg_event_<call>,
625 * .show_format = ftrace_format_<call>,
626 * } 501 * }
627 * 502 *
628 */ 503 */
@@ -657,6 +532,12 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
657#define __assign_str(dst, src) \ 532#define __assign_str(dst, src) \
658 strcpy(__get_str(dst), src); 533 strcpy(__get_str(dst), src);
659 534
535#undef TP_fast_assign
536#define TP_fast_assign(args...) args
537
538#undef TP_perf_assign
539#define TP_perf_assign(args...)
540
660#undef DECLARE_EVENT_CLASS 541#undef DECLARE_EVENT_CLASS
661#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 542#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
662 \ 543 \
@@ -750,7 +631,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
750 .regfunc = ftrace_raw_reg_event_##call, \ 631 .regfunc = ftrace_raw_reg_event_##call, \
751 .unregfunc = ftrace_raw_unreg_event_##call, \ 632 .unregfunc = ftrace_raw_unreg_event_##call, \
752 .print_fmt = print_fmt_##template, \ 633 .print_fmt = print_fmt_##template, \
753 .show_format = ftrace_format_##template, \
754 .define_fields = ftrace_define_fields_##template, \ 634 .define_fields = ftrace_define_fields_##template, \
755 _TRACE_PROFILE_INIT(call) \ 635 _TRACE_PROFILE_INIT(call) \
756} 636}
@@ -770,7 +650,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
770 .regfunc = ftrace_raw_reg_event_##call, \ 650 .regfunc = ftrace_raw_reg_event_##call, \
771 .unregfunc = ftrace_raw_unreg_event_##call, \ 651 .unregfunc = ftrace_raw_unreg_event_##call, \
772 .print_fmt = print_fmt_##call, \ 652 .print_fmt = print_fmt_##call, \
773 .show_format = ftrace_format_##call, \
774 .define_fields = ftrace_define_fields_##template, \ 653 .define_fields = ftrace_define_fields_##template, \
775 _TRACE_PROFILE_INIT(call) \ 654 _TRACE_PROFILE_INIT(call) \
776} 655}
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 961fda3556bb..8cd410254456 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -34,10 +34,6 @@ struct syscall_metadata {
34extern unsigned long arch_syscall_addr(int nr); 34extern unsigned long arch_syscall_addr(int nr);
35extern int init_syscall_trace(struct ftrace_event_call *call); 35extern int init_syscall_trace(struct ftrace_event_call *call);
36 36
37extern int syscall_enter_format(struct ftrace_event_call *call,
38 struct trace_seq *s);
39extern int syscall_exit_format(struct ftrace_event_call *call,
40 struct trace_seq *s);
41extern int syscall_enter_define_fields(struct ftrace_event_call *call); 37extern int syscall_enter_define_fields(struct ftrace_event_call *call);
42extern int syscall_exit_define_fields(struct ftrace_event_call *call); 38extern int syscall_exit_define_fields(struct ftrace_event_call *call);
43extern int reg_event_syscall_enter(struct ftrace_event_call *call); 39extern int reg_event_syscall_enter(struct ftrace_event_call *call);
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 250ec865d5f5..c2a3077b7353 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -520,14 +520,6 @@ out:
520 return ret; 520 return ret;
521} 521}
522 522
523extern char *__bad_type_size(void);
524
525#undef FIELD
526#define FIELD(type, name) \
527 sizeof(type) != sizeof(field.name) ? __bad_type_size() : \
528 #type, "common_" #name, offsetof(typeof(field), name), \
529 sizeof(field.name), is_signed_type(type)
530
531static ssize_t 523static ssize_t
532event_format_read(struct file *filp, char __user *ubuf, size_t cnt, 524event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
533 loff_t *ppos) 525 loff_t *ppos)
@@ -965,10 +957,6 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
965 filter); 957 filter);
966 } 958 }
967 959
968 /* A trace may not want to export its format */
969 if (!call->show_format)
970 return 0;
971
972 trace_create_file("format", 0444, call->dir, call, 960 trace_create_file("format", 0444, call->dir, call,
973 format); 961 format);
974 962
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 95d14b640a66..e091f64ba6ce 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -62,78 +62,6 @@ static void __always_unused ____ftrace_check_##name(void) \
62 62
63#include "trace_entries.h" 63#include "trace_entries.h"
64 64
65
66#undef __field
67#define __field(type, item) \
68 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
69 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
70 offsetof(typeof(field), item), \
71 sizeof(field.item), is_signed_type(type)); \
72 if (!ret) \
73 return 0;
74
75#undef __field_desc
76#define __field_desc(type, container, item) \
77 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
78 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
79 offsetof(typeof(field), container.item), \
80 sizeof(field.container.item), \
81 is_signed_type(type)); \
82 if (!ret) \
83 return 0;
84
85#undef __array
86#define __array(type, item, len) \
87 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
88 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
89 offsetof(typeof(field), item), \
90 sizeof(field.item), is_signed_type(type)); \
91 if (!ret) \
92 return 0;
93
94#undef __array_desc
95#define __array_desc(type, container, item, len) \
96 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
97 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
98 offsetof(typeof(field), container.item), \
99 sizeof(field.container.item), \
100 is_signed_type(type)); \
101 if (!ret) \
102 return 0;
103
104#undef __dynamic_array
105#define __dynamic_array(type, item) \
106 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
107 "offset:%zu;\tsize:0;\tsigned:%u;\n", \
108 offsetof(typeof(field), item), \
109 is_signed_type(type)); \
110 if (!ret) \
111 return 0;
112
113#undef F_printk
114#define F_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
115
116#undef __entry
117#define __entry REC
118
119#undef FTRACE_ENTRY
120#define FTRACE_ENTRY(name, struct_name, id, tstruct, print) \
121static int \
122ftrace_format_##name(struct ftrace_event_call *unused, \
123 struct trace_seq *s) \
124{ \
125 struct struct_name field __attribute__((unused)); \
126 int ret = 0; \
127 \
128 tstruct; \
129 \
130 trace_seq_printf(s, "\nprint fmt: " print); \
131 \
132 return ret; \
133}
134
135#include "trace_entries.h"
136
137#undef __field 65#undef __field
138#define __field(type, item) \ 66#define __field(type, item) \
139 ret = trace_define_field(event_call, #type, #item, \ 67 ret = trace_define_field(event_call, #type, #item, \
@@ -235,7 +163,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
235 .system = __stringify(TRACE_SYSTEM), \ 163 .system = __stringify(TRACE_SYSTEM), \
236 .raw_init = ftrace_raw_init_event, \ 164 .raw_init = ftrace_raw_init_event, \
237 .print_fmt = print, \ 165 .print_fmt = print, \
238 .show_format = ftrace_format_##call, \
239 .define_fields = ftrace_define_fields_##call, \ 166 .define_fields = ftrace_define_fields_##call, \
240}; \ 167}; \
241 168
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 147491dccead..c99029916c76 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1174,82 +1174,6 @@ static int kretprobe_event_define_fields(struct ftrace_event_call *event_call)
1174 return 0; 1174 return 0;
1175} 1175}
1176 1176
1177static int __probe_event_show_format(struct trace_seq *s,
1178 struct trace_probe *tp, const char *fmt,
1179 const char *arg)
1180{
1181 int i;
1182
1183 /* Show format */
1184 if (!trace_seq_printf(s, "\nprint fmt: \"%s", fmt))
1185 return 0;
1186
1187 for (i = 0; i < tp->nr_args; i++)
1188 if (!trace_seq_printf(s, " %s=%%lx", tp->args[i].name))
1189 return 0;
1190
1191 if (!trace_seq_printf(s, "\", %s", arg))
1192 return 0;
1193
1194 for (i = 0; i < tp->nr_args; i++)
1195 if (!trace_seq_printf(s, ", REC->%s", tp->args[i].name))
1196 return 0;
1197
1198 return trace_seq_puts(s, "\n");
1199}
1200
1201#undef SHOW_FIELD
1202#define SHOW_FIELD(type, item, name) \
1203 do { \
1204 ret = trace_seq_printf(s, "\tfield:" #type " %s;\t" \
1205 "offset:%u;\tsize:%u;\tsigned:%d;\n", name,\
1206 (unsigned int)offsetof(typeof(field), item),\
1207 (unsigned int)sizeof(type), \
1208 is_signed_type(type)); \
1209 if (!ret) \
1210 return 0; \
1211 } while (0)
1212
1213static int kprobe_event_show_format(struct ftrace_event_call *call,
1214 struct trace_seq *s)
1215{
1216 struct kprobe_trace_entry field __attribute__((unused));
1217 int ret, i;
1218 struct trace_probe *tp = (struct trace_probe *)call->data;
1219
1220 SHOW_FIELD(unsigned long, ip, FIELD_STRING_IP);
1221 SHOW_FIELD(int, nargs, FIELD_STRING_NARGS);
1222
1223 /* Show fields */
1224 for (i = 0; i < tp->nr_args; i++)
1225 SHOW_FIELD(unsigned long, args[i], tp->args[i].name);
1226 trace_seq_puts(s, "\n");
1227
1228 return __probe_event_show_format(s, tp, "(%lx)",
1229 "REC->" FIELD_STRING_IP);
1230}
1231
1232static int kretprobe_event_show_format(struct ftrace_event_call *call,
1233 struct trace_seq *s)
1234{
1235 struct kretprobe_trace_entry field __attribute__((unused));
1236 int ret, i;
1237 struct trace_probe *tp = (struct trace_probe *)call->data;
1238
1239 SHOW_FIELD(unsigned long, func, FIELD_STRING_FUNC);
1240 SHOW_FIELD(unsigned long, ret_ip, FIELD_STRING_RETIP);
1241 SHOW_FIELD(int, nargs, FIELD_STRING_NARGS);
1242
1243 /* Show fields */
1244 for (i = 0; i < tp->nr_args; i++)
1245 SHOW_FIELD(unsigned long, args[i], tp->args[i].name);
1246 trace_seq_puts(s, "\n");
1247
1248 return __probe_event_show_format(s, tp, "(%lx <- %lx)",
1249 "REC->" FIELD_STRING_FUNC
1250 ", REC->" FIELD_STRING_RETIP);
1251}
1252
1253static int __set_print_fmt(struct trace_probe *tp, char *buf, int len) 1177static int __set_print_fmt(struct trace_probe *tp, char *buf, int len)
1254{ 1178{
1255 int i; 1179 int i;
@@ -1504,12 +1428,10 @@ static int register_probe_event(struct trace_probe *tp)
1504 if (probe_is_return(tp)) { 1428 if (probe_is_return(tp)) {
1505 tp->event.trace = print_kretprobe_event; 1429 tp->event.trace = print_kretprobe_event;
1506 call->raw_init = probe_event_raw_init; 1430 call->raw_init = probe_event_raw_init;
1507 call->show_format = kretprobe_event_show_format;
1508 call->define_fields = kretprobe_event_define_fields; 1431 call->define_fields = kretprobe_event_define_fields;
1509 } else { 1432 } else {
1510 tp->event.trace = print_kprobe_event; 1433 tp->event.trace = print_kprobe_event;
1511 call->raw_init = probe_event_raw_init; 1434 call->raw_init = probe_event_raw_init;
1512 call->show_format = kprobe_event_show_format;
1513 call->define_fields = kprobe_event_define_fields; 1435 call->define_fields = kprobe_event_define_fields;
1514 } 1436 }
1515 if (set_print_fmt(tp) < 0) 1437 if (set_print_fmt(tp) < 0)
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index a78e86349ecb..49cea70fbf6d 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -143,54 +143,6 @@ extern char *__bad_type_size(void);
143 #type, #name, offsetof(typeof(trace), name), \ 143 #type, #name, offsetof(typeof(trace), name), \
144 sizeof(trace.name), is_signed_type(type) 144 sizeof(trace.name), is_signed_type(type)
145 145
146int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
147{
148 int i;
149 int ret;
150 struct syscall_metadata *entry = call->data;
151 struct syscall_trace_enter trace;
152 int offset = offsetof(struct syscall_trace_enter, args);
153
154 ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
155 "\tsigned:%u;\n",
156 SYSCALL_FIELD(int, nr));
157 if (!ret)
158 return 0;
159
160 for (i = 0; i < entry->nb_args; i++) {
161 ret = trace_seq_printf(s, "\tfield:%s %s;", entry->types[i],
162 entry->args[i]);
163 if (!ret)
164 return 0;
165 ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;"
166 "\tsigned:%u;\n", offset,
167 sizeof(unsigned long),
168 is_signed_type(unsigned long));
169 if (!ret)
170 return 0;
171 offset += sizeof(unsigned long);
172 }
173
174 trace_seq_puts(s, "\nprint fmt: \"");
175 for (i = 0; i < entry->nb_args; i++) {
176 ret = trace_seq_printf(s, "%s: 0x%%0%zulx%s", entry->args[i],
177 sizeof(unsigned long),
178 i == entry->nb_args - 1 ? "" : ", ");
179 if (!ret)
180 return 0;
181 }
182 trace_seq_putc(s, '"');
183
184 for (i = 0; i < entry->nb_args; i++) {
185 ret = trace_seq_printf(s, ", ((unsigned long)(REC->%s))",
186 entry->args[i]);
187 if (!ret)
188 return 0;
189 }
190
191 return trace_seq_putc(s, '\n');
192}
193
194static 146static
195int __set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len) 147int __set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len)
196{ 148{
@@ -252,24 +204,6 @@ static void free_syscall_print_fmt(struct ftrace_event_call *call)
252 kfree(call->print_fmt); 204 kfree(call->print_fmt);
253} 205}
254 206
255int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
256{
257 int ret;
258 struct syscall_trace_exit trace;
259
260 ret = trace_seq_printf(s,
261 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
262 "\tsigned:%u;\n"
263 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
264 "\tsigned:%u;\n",
265 SYSCALL_FIELD(int, nr),
266 SYSCALL_FIELD(long, ret));
267 if (!ret)
268 return 0;
269
270 return trace_seq_printf(s, "\nprint fmt: \"0x%%lx\", REC->ret\n");
271}
272
273int syscall_enter_define_fields(struct ftrace_event_call *call) 207int syscall_enter_define_fields(struct ftrace_event_call *call)
274{ 208{
275 struct syscall_trace_enter trace; 209 struct syscall_trace_enter trace;