diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-08-20 19:36:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:36:34 -0400 |
commit | a6168353d1c0b24b7512e14d1c3e47ed69881a23 (patch) | |
tree | f019f0304ed7465b5dbe25374a62fa704196749a /kernel/trace | |
parent | 2ff01c6a17391225a18256d510b6e5b4aba40aa1 (diff) |
ftrace: make output nicely spaced for up to 999 cpus
Currently some of the ftrace output goes skewiff if you have more
than 9 cpus, and some if you have more than 99.
Twiddle with the headers and format strings to make up to 999 cpus
display without causing spacing problems.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 896e59f772c9..1801900908e1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1409,21 +1409,21 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags) | |||
1409 | 1409 | ||
1410 | static void print_lat_help_header(struct seq_file *m) | 1410 | static void print_lat_help_header(struct seq_file *m) |
1411 | { | 1411 | { |
1412 | seq_puts(m, "# _------=> CPU# \n"); | 1412 | seq_puts(m, "# _------=> CPU# \n"); |
1413 | seq_puts(m, "# / _-----=> irqs-off \n"); | 1413 | seq_puts(m, "# / _-----=> irqs-off \n"); |
1414 | seq_puts(m, "# | / _----=> need-resched \n"); | 1414 | seq_puts(m, "# | / _----=> need-resched \n"); |
1415 | seq_puts(m, "# || / _---=> hardirq/softirq \n"); | 1415 | seq_puts(m, "# || / _---=> hardirq/softirq \n"); |
1416 | seq_puts(m, "# ||| / _--=> preempt-depth \n"); | 1416 | seq_puts(m, "# ||| / _--=> preempt-depth \n"); |
1417 | seq_puts(m, "# |||| / \n"); | 1417 | seq_puts(m, "# |||| / \n"); |
1418 | seq_puts(m, "# ||||| delay \n"); | 1418 | seq_puts(m, "# ||||| delay \n"); |
1419 | seq_puts(m, "# cmd pid ||||| time | caller \n"); | 1419 | seq_puts(m, "# cmd pid ||||| time | caller \n"); |
1420 | seq_puts(m, "# \\ / ||||| \\ | / \n"); | 1420 | seq_puts(m, "# \\ / ||||| \\ | / \n"); |
1421 | } | 1421 | } |
1422 | 1422 | ||
1423 | static void print_func_help_header(struct seq_file *m) | 1423 | static void print_func_help_header(struct seq_file *m) |
1424 | { | 1424 | { |
1425 | seq_puts(m, "# TASK-PID CPU# TIMESTAMP FUNCTION\n"); | 1425 | seq_puts(m, "# TASK-PID CPU# TIMESTAMP FUNCTION\n"); |
1426 | seq_puts(m, "# | | | | |\n"); | 1426 | seq_puts(m, "# | | | | |\n"); |
1427 | } | 1427 | } |
1428 | 1428 | ||
1429 | 1429 | ||
@@ -1508,7 +1508,7 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) | |||
1508 | comm = trace_find_cmdline(field->pid); | 1508 | comm = trace_find_cmdline(field->pid); |
1509 | 1509 | ||
1510 | trace_seq_printf(s, "%8.8s-%-5d ", comm, field->pid); | 1510 | trace_seq_printf(s, "%8.8s-%-5d ", comm, field->pid); |
1511 | trace_seq_printf(s, "%d", cpu); | 1511 | trace_seq_printf(s, "%3d", cpu); |
1512 | trace_seq_printf(s, "%c%c", | 1512 | trace_seq_printf(s, "%c%c", |
1513 | (field->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : '.', | 1513 | (field->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : '.', |
1514 | ((field->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.')); | 1514 | ((field->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.')); |
@@ -1598,7 +1598,7 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) | |||
1598 | 1598 | ||
1599 | if (verbose) { | 1599 | if (verbose) { |
1600 | comm = trace_find_cmdline(field->pid); | 1600 | comm = trace_find_cmdline(field->pid); |
1601 | trace_seq_printf(s, "%16s %5d %d %d %08x %08x [%08lx]" | 1601 | trace_seq_printf(s, "%16s %5d %3d %d %08x %08x [%08lx]" |
1602 | " %ld.%03ldms (+%ld.%03ldms): ", | 1602 | " %ld.%03ldms (+%ld.%03ldms): ", |
1603 | comm, | 1603 | comm, |
1604 | field->pid, cpu, field->flags, | 1604 | field->pid, cpu, field->flags, |
@@ -1694,7 +1694,7 @@ static int print_trace_fmt(struct trace_iterator *iter) | |||
1694 | ret = trace_seq_printf(s, "%16s-%-5d ", comm, field->pid); | 1694 | ret = trace_seq_printf(s, "%16s-%-5d ", comm, field->pid); |
1695 | if (!ret) | 1695 | if (!ret) |
1696 | return 0; | 1696 | return 0; |
1697 | ret = trace_seq_printf(s, "[%02d] ", iter->cpu); | 1697 | ret = trace_seq_printf(s, "[%03d] ", iter->cpu); |
1698 | if (!ret) | 1698 | if (!ret) |
1699 | return 0; | 1699 | return 0; |
1700 | ret = trace_seq_printf(s, "%5lu.%06lu: ", secs, usec_rem); | 1700 | ret = trace_seq_printf(s, "%5lu.%06lu: ", secs, usec_rem); |