diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-02-04 17:16:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-05 08:35:46 -0500 |
commit | 268ccda0cb4d1292029d07ee3dbd07117baf6ecb (patch) | |
tree | 7683e02758d3f768ad21414abf39b00773e87940 /kernel/trace/trace_output.c | |
parent | 43769f10b4826376cbf4ce17af74a5b4e8dc4fcd (diff) |
trace: assign defaults at register_ftrace_event
Impact: simplification of tracers
As all tracers are doing this we might as well do it in
register_ftrace_event and save one branch each time we call these
callbacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index b7380eee9fa1..b6e99af79214 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -435,6 +435,17 @@ int register_ftrace_event(struct trace_event *event) | |||
435 | if (ftrace_find_event(event->type)) | 435 | if (ftrace_find_event(event->type)) |
436 | goto out; | 436 | goto out; |
437 | 437 | ||
438 | if (event->trace == NULL) | ||
439 | event->trace = trace_nop_print; | ||
440 | if (event->latency_trace == NULL) | ||
441 | event->latency_trace = trace_nop_print; | ||
442 | if (event->raw == NULL) | ||
443 | event->raw = trace_nop_print; | ||
444 | if (event->hex == NULL) | ||
445 | event->hex = trace_nop_print; | ||
446 | if (event->binary == NULL) | ||
447 | event->binary = trace_nop_print; | ||
448 | |||
438 | key = event->type & (EVENT_HASHSIZE - 1); | 449 | key = event->type & (EVENT_HASHSIZE - 1); |
439 | 450 | ||
440 | hlist_add_head_rcu(&event->node, &event_hash[key]); | 451 | hlist_add_head_rcu(&event->node, &event_hash[key]); |
@@ -874,8 +885,6 @@ static struct trace_event trace_print_event = { | |||
874 | .trace = trace_print_print, | 885 | .trace = trace_print_print, |
875 | .latency_trace = trace_print_print, | 886 | .latency_trace = trace_print_print, |
876 | .raw = trace_print_raw, | 887 | .raw = trace_print_raw, |
877 | .hex = trace_nop_print, | ||
878 | .binary = trace_nop_print, | ||
879 | }; | 888 | }; |
880 | 889 | ||
881 | static struct trace_event *events[] __initdata = { | 890 | static struct trace_event *events[] __initdata = { |