aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2009-07-21 23:21:31 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-07-23 20:51:35 -0400
commitd857ace143df3884954887e1899a65831ca72ece (patch)
tree8fda34760ccdea95bb62cb66b425eb9dd7bb74a8
parent9d7e934408b52cd53dd85270eb36941a6a318cc5 (diff)
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>
-rw-r--r--kernel/trace/trace_ksym.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index 1256a6e8ee24..fbf3a8e13bc5 100644
--- a/kernel/trace/trace_ksym.c
+++ b/kernel/trace/trace_ksym.c
@@ -370,13 +370,12 @@ static int ksym_trace_init(struct trace_array *tr)
370 370
371static void ksym_trace_print_header(struct seq_file *m) 371static void ksym_trace_print_header(struct seq_file *m)
372{ 372{
373
374 seq_puts(m, 373 seq_puts(m,
375 "# TASK-PID CPU# Symbol Type " 374 "# TASK-PID CPU# Symbol "
376 "Function \n"); 375 "Type Function\n");
377 seq_puts(m, 376 seq_puts(m,
378 "# | | | | " 377 "# | | | "
379 "| \n"); 378 " | |\n");
380} 379}
381 380
382static enum print_line_t ksym_trace_output(struct trace_iterator *iter) 381static 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)
392 391
393 trace_assign_type(field, entry); 392 trace_assign_type(field, entry);
394 393
395 ret = trace_seq_printf(s, "%-15s %-5d %-3d %-20s ", field->cmd, 394 ret = trace_seq_printf(s, "%11s-%-5d [%03d] %-30s ", field->cmd,
396 entry->pid, iter->cpu, field->ksym_name); 395 entry->pid, iter->cpu, field->ksym_name);
397 if (!ret) 396 if (!ret)
398 return TRACE_TYPE_PARTIAL_LINE; 397 return TRACE_TYPE_PARTIAL_LINE;
@@ -412,7 +411,7 @@ static enum print_line_t ksym_trace_output(struct trace_iterator *iter)
412 return TRACE_TYPE_PARTIAL_LINE; 411 return TRACE_TYPE_PARTIAL_LINE;
413 412
414 sprint_symbol(str, field->ip); 413 sprint_symbol(str, field->ip);
415 ret = trace_seq_printf(s, "%-20s\n", str); 414 ret = trace_seq_printf(s, "%s\n", str);
416 if (!ret) 415 if (!ret)
417 return TRACE_TYPE_PARTIAL_LINE; 416 return TRACE_TYPE_PARTIAL_LINE;
418 417