diff options
author | Li Zefan <lizefan@huawei.com> | 2013-02-20 21:32:38 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-03-15 00:34:51 -0400 |
commit | f71130de5c7fba92faf3901784714e37a234c08f (patch) | |
tree | 3632ac6de403c726b2ea8bb890f573c9fd6c54bc /include/trace | |
parent | 15693458c4bc0693fd63a50d60f35b628fcf4e29 (diff) |
tracing: Add a helper function for event print functions
Move duplicate code in event print functions to a helper function.
This shrinks the size of the kernel by ~13K.
text data bss dec hex filename
6596137 1743966 10138672 18478775 119f6b7 vmlinux.o.old
6583002 1743849 10138672 18465523 119c2f3 vmlinux.o.new
Link: http://lkml.kernel.org/r/51258746.2060304@huawei.com
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/ftrace.h | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index e5d140a91fd7..17a77fcac2a2 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -227,29 +227,18 @@ static notrace enum print_line_t \ | |||
227 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | 227 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ |
228 | struct trace_event *trace_event) \ | 228 | struct trace_event *trace_event) \ |
229 | { \ | 229 | { \ |
230 | struct ftrace_event_call *event; \ | ||
231 | struct trace_seq *s = &iter->seq; \ | 230 | struct trace_seq *s = &iter->seq; \ |
231 | struct trace_seq __maybe_unused *p = &iter->tmp_seq; \ | ||
232 | struct ftrace_raw_##call *field; \ | 232 | struct ftrace_raw_##call *field; \ |
233 | struct trace_entry *entry; \ | ||
234 | struct trace_seq *p = &iter->tmp_seq; \ | ||
235 | int ret; \ | 233 | int ret; \ |
236 | \ | 234 | \ |
237 | event = container_of(trace_event, struct ftrace_event_call, \ | 235 | field = (typeof(field))iter->ent; \ |
238 | event); \ | ||
239 | \ | ||
240 | entry = iter->ent; \ | ||
241 | \ | 236 | \ |
242 | if (entry->type != event->event.type) { \ | 237 | ret = ftrace_raw_output_prep(iter, trace_event); \ |
243 | WARN_ON_ONCE(1); \ | ||
244 | return TRACE_TYPE_UNHANDLED; \ | ||
245 | } \ | ||
246 | \ | ||
247 | field = (typeof(field))entry; \ | ||
248 | \ | ||
249 | trace_seq_init(p); \ | ||
250 | ret = trace_seq_printf(s, "%s: ", event->name); \ | ||
251 | if (ret) \ | 238 | if (ret) \ |
252 | ret = trace_seq_printf(s, print); \ | 239 | return ret; \ |
240 | \ | ||
241 | ret = trace_seq_printf(s, print); \ | ||
253 | if (!ret) \ | 242 | if (!ret) \ |
254 | return TRACE_TYPE_PARTIAL_LINE; \ | 243 | return TRACE_TYPE_PARTIAL_LINE; \ |
255 | \ | 244 | \ |