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.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.c')
-rw-r--r-- | kernel/trace/trace.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index fd51cf0b94c7..a5e4c0af9bb0 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1412,7 +1412,7 @@ static enum print_line_t print_lat_fmt(struct trace_iterator *iter) | |||
1412 | goto partial; | 1412 | goto partial; |
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | if (event && event->latency_trace) | 1415 | if (event) |
1416 | return event->latency_trace(iter, sym_flags); | 1416 | return event->latency_trace(iter, sym_flags); |
1417 | 1417 | ||
1418 | if (!trace_seq_printf(s, "Unknown type %d\n", entry->type)) | 1418 | if (!trace_seq_printf(s, "Unknown type %d\n", entry->type)) |
@@ -1441,7 +1441,7 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | |||
1441 | goto partial; | 1441 | goto partial; |
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | if (event && event->trace) | 1444 | if (event) |
1445 | return event->trace(iter, sym_flags); | 1445 | return event->trace(iter, sym_flags); |
1446 | 1446 | ||
1447 | if (!trace_seq_printf(s, "Unknown type %d\n", entry->type)) | 1447 | if (!trace_seq_printf(s, "Unknown type %d\n", entry->type)) |
@@ -1467,7 +1467,7 @@ static enum print_line_t print_raw_fmt(struct trace_iterator *iter) | |||
1467 | } | 1467 | } |
1468 | 1468 | ||
1469 | event = ftrace_find_event(entry->type); | 1469 | event = ftrace_find_event(entry->type); |
1470 | if (event && event->raw) | 1470 | if (event) |
1471 | return event->raw(iter, 0); | 1471 | return event->raw(iter, 0); |
1472 | 1472 | ||
1473 | if (!trace_seq_printf(s, "%d ?\n", entry->type)) | 1473 | if (!trace_seq_printf(s, "%d ?\n", entry->type)) |
@@ -1494,7 +1494,7 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter) | |||
1494 | } | 1494 | } |
1495 | 1495 | ||
1496 | event = ftrace_find_event(entry->type); | 1496 | event = ftrace_find_event(entry->type); |
1497 | if (event && event->hex) { | 1497 | if (event) { |
1498 | enum print_line_t ret = event->hex(iter, 0); | 1498 | enum print_line_t ret = event->hex(iter, 0); |
1499 | if (ret != TRACE_TYPE_HANDLED) | 1499 | if (ret != TRACE_TYPE_HANDLED) |
1500 | return ret; | 1500 | return ret; |
@@ -1536,10 +1536,7 @@ static enum print_line_t print_bin_fmt(struct trace_iterator *iter) | |||
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | event = ftrace_find_event(entry->type); | 1538 | event = ftrace_find_event(entry->type); |
1539 | if (event && event->binary) | 1539 | return event ? event->binary(iter, 0) : TRACE_TYPE_HANDLED; |
1540 | return event->binary(iter, 0); | ||
1541 | |||
1542 | return TRACE_TYPE_HANDLED; | ||
1543 | } | 1540 | } |
1544 | 1541 | ||
1545 | static int trace_empty(struct trace_iterator *iter) | 1542 | static int trace_empty(struct trace_iterator *iter) |