tracing/ksym_tracer: fix the output of ksym tracer

Fix the output format of ksym tracer, make it properly aligned

Befor patch:
# tracer: ksym_tracer
#
#       TASK-PID      CPU#      Symbol         Type    Function
#          |           |          |              |         |
bash            1378  1   ksym_tracer_mutex     W  mutex_lock+0x11/0x27
bash            1378  1   ksym_filter_head      W  process_new_ksym_entry+0xd2/0x10c
bash            1378  1   ksym_tracer_mutex     W  mutex_unlock+0x12/0x1b
cat             1429  0   ksym_tracer_mutex     W  mutex_lock+0x11/0x27

After patch:
# tracer: ksym_tracer
#
#       TASK-PID   CPU#      Symbol                    Type    Function
#          |        |          |                        |         |
        cat-1423  [000] ksym_tracer_mutex               RW mutex_lock+0x11/0x27
        cat-1423  [000] ksym_filter_head                RW ksym_trace_filter_read+0x6e/0x10d
        cat-1423  [000] ksym_tracer_mutex               RW mutex_unlock+0x12/0x1b
        cat-1423  [000] ksym_tracer_mutex               RW mutex_lock+0x11/0x27
        cat-1423  [000] ksym_filter_head                RW ksym_trace_filter_read+0x6e/0x10d
        cat-1423  [000] ksym_tracer_mutex               RW mutex_unlock+0x12/0x1b

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
LKML-Reference: <4A6685BB.2090809@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
Xiao Guangrong 2009-07-22 11:21:31 +08:00 committed by Steven Rostedt
parent 9d7e934408
commit d857ace143
1 changed files with 6 additions and 7 deletions

View File

@ -370,13 +370,12 @@ static int ksym_trace_init(struct trace_array *tr)
static void ksym_trace_print_header(struct seq_file *m) static void ksym_trace_print_header(struct seq_file *m)
{ {
seq_puts(m, seq_puts(m,
"# TASK-PID CPU# Symbol Type " "# TASK-PID CPU# Symbol "
"Function \n"); "Type Function\n");
seq_puts(m, seq_puts(m,
"# | | | | " "# | | | "
"| \n"); " | |\n");
} }
static enum print_line_t ksym_trace_output(struct trace_iterator *iter) static enum print_line_t ksym_trace_output(struct trace_iterator *iter)
@ -392,7 +391,7 @@ static enum print_line_t ksym_trace_output(struct trace_iterator *iter)
trace_assign_type(field, entry); trace_assign_type(field, entry);
ret = trace_seq_printf(s, "%-15s %-5d %-3d %-20s ", field->cmd, ret = trace_seq_printf(s, "%11s-%-5d [%03d] %-30s ", field->cmd,
entry->pid, iter->cpu, field->ksym_name); entry->pid, iter->cpu, field->ksym_name);
if (!ret) if (!ret)
return TRACE_TYPE_PARTIAL_LINE; return TRACE_TYPE_PARTIAL_LINE;
@ -412,7 +411,7 @@ static enum print_line_t ksym_trace_output(struct trace_iterator *iter)
return TRACE_TYPE_PARTIAL_LINE; return TRACE_TYPE_PARTIAL_LINE;
sprint_symbol(str, field->ip); sprint_symbol(str, field->ip);
ret = trace_seq_printf(s, "%-20s\n", str); ret = trace_seq_printf(s, "%s\n", str);
if (!ret) if (!ret)
return TRACE_TYPE_PARTIAL_LINE; return TRACE_TYPE_PARTIAL_LINE;