diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-04 21:57:29 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-04 21:57:29 -0500 |
commit | 27d48be84477d2f0a2e2ac3738a3971dece631d5 (patch) | |
tree | 92d4b896df1102b0aaa3c01d71fdecd75faa601f /kernel/trace/trace.c | |
parent | 5fd73f862468280d4cbb5ba4321502f911f9f89a (diff) |
tracing: consolidate print_lat_fmt and print_trace_fmt
Impact: clean up
Both print_lat_fmt and print_trace_fmt do pretty much the same thing
except for one different function call. This patch consolidates the
two functions and adds an if statement to perform the difference.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 21b89ecb8480..d1ef43999d9e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1468,33 +1468,6 @@ static void test_cpu_buff_start(struct trace_iterator *iter) | |||
1468 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); | 1468 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); |
1469 | } | 1469 | } |
1470 | 1470 | ||
1471 | static enum print_line_t print_lat_fmt(struct trace_iterator *iter) | ||
1472 | { | ||
1473 | struct trace_seq *s = &iter->seq; | ||
1474 | unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); | ||
1475 | struct trace_event *event; | ||
1476 | struct trace_entry *entry = iter->ent; | ||
1477 | |||
1478 | test_cpu_buff_start(iter); | ||
1479 | |||
1480 | event = ftrace_find_event(entry->type); | ||
1481 | |||
1482 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { | ||
1483 | if (!trace_print_lat_context(iter)) | ||
1484 | goto partial; | ||
1485 | } | ||
1486 | |||
1487 | if (event) | ||
1488 | return event->trace(iter, sym_flags); | ||
1489 | |||
1490 | if (!trace_seq_printf(s, "Unknown type %d\n", entry->type)) | ||
1491 | goto partial; | ||
1492 | |||
1493 | return TRACE_TYPE_HANDLED; | ||
1494 | partial: | ||
1495 | return TRACE_TYPE_PARTIAL_LINE; | ||
1496 | } | ||
1497 | |||
1498 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | 1471 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) |
1499 | { | 1472 | { |
1500 | struct trace_seq *s = &iter->seq; | 1473 | struct trace_seq *s = &iter->seq; |
@@ -1509,8 +1482,13 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | |||
1509 | event = ftrace_find_event(entry->type); | 1482 | event = ftrace_find_event(entry->type); |
1510 | 1483 | ||
1511 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { | 1484 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { |
1512 | if (!trace_print_context(iter)) | 1485 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) { |
1513 | goto partial; | 1486 | if (!trace_print_lat_context(iter)) |
1487 | goto partial; | ||
1488 | } else { | ||
1489 | if (!trace_print_context(iter)) | ||
1490 | goto partial; | ||
1491 | } | ||
1514 | } | 1492 | } |
1515 | 1493 | ||
1516 | if (event) | 1494 | if (event) |
@@ -1652,9 +1630,6 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter) | |||
1652 | if (trace_flags & TRACE_ITER_RAW) | 1630 | if (trace_flags & TRACE_ITER_RAW) |
1653 | return print_raw_fmt(iter); | 1631 | return print_raw_fmt(iter); |
1654 | 1632 | ||
1655 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) | ||
1656 | return print_lat_fmt(iter); | ||
1657 | |||
1658 | return print_trace_fmt(iter); | 1633 | return print_trace_fmt(iter); |
1659 | } | 1634 | } |
1660 | 1635 | ||