public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Li Zefan <lizf@cn.fujitsu.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	stern@rowland.harvard.edu, lizf@cn.fujitsu.com,
	fweisbec@gmail.com, rostedt@goodmis.org, tglx@linutronix.de,
	mingo@elte.hu, prasad@linux.vnet.ibm.com
Subject: [tip:perf/core] ksym_tracer: Fix the output of stat tracing
Date: Sat, 21 Nov 2009 13:35:21 GMT	[thread overview]
Message-ID: <tip-9d7e934408b52cd53dd85270eb36941a6a318cc5@git.kernel.org> (raw)
In-Reply-To: <4A52E346.5050608@cn.fujitsu.com>

Commit-ID:  9d7e934408b52cd53dd85270eb36941a6a318cc5
Gitweb:     http://git.kernel.org/tip/9d7e934408b52cd53dd85270eb36941a6a318cc5
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Tue, 7 Jul 2009 13:55:18 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 10 Jul 2009 11:59:44 +0200

ksym_tracer: Fix the output of stat tracing

- make ksym_tracer_stat_start() return head->first instead of
  &head->first
- make the output properly aligned

Before:

   Access type                Symbol                     Counter
     NA                   <NA>                              0
     RW                   pid_max                               0

After:

  Access Type   Symbol                                       Counter
  -----------   ------                                       -------
  RW            pid_max                                            0

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <4A52E346.5050608@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/trace/trace_ksym.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index 7d349d3..1256a6e 100644
--- a/kernel/trace/trace_ksym.c
+++ b/kernel/trace/trace_ksym.c
@@ -453,8 +453,10 @@ device_initcall(init_ksym_trace);
 #ifdef CONFIG_PROFILE_KSYM_TRACER
 static int ksym_tracer_stat_headers(struct seq_file *m)
 {
-	seq_printf(m, "   Access type    ");
-	seq_printf(m, "            Symbol                     Counter     \n");
+	seq_puts(m, "  Access Type ");
+	seq_puts(m, "  Symbol                                       Counter\n");
+	seq_puts(m, "  ----------- ");
+	seq_puts(m, "  ------                                       -------\n");
 	return 0;
 }
 
@@ -472,27 +474,27 @@ static int ksym_tracer_stat_show(struct seq_file *m, void *v)
 
 	switch (access_type) {
 	case HW_BREAKPOINT_WRITE:
-		seq_printf(m, "     W     ");
+		seq_puts(m, "  W           ");
 		break;
 	case HW_BREAKPOINT_RW:
-		seq_printf(m, "     RW    ");
+		seq_puts(m, "  RW          ");
 		break;
 	default:
-		seq_printf(m, "     NA    ");
+		seq_puts(m, "  NA          ");
 	}
 
 	if (lookup_symbol_name(entry->ksym_addr, fn_name) >= 0)
-		seq_printf(m, "               %s                 ", fn_name);
+		seq_printf(m, "  %-36s", fn_name);
 	else
-		seq_printf(m, "               <NA>                ");
+		seq_printf(m, "  %-36s", "<NA>");
+	seq_printf(m, " %15lu\n", entry->counter);
 
-	seq_printf(m, "%15lu\n", entry->counter);
 	return 0;
 }
 
 static void *ksym_tracer_stat_start(struct tracer_stat *trace)
 {
-	return &(ksym_filter_head.first);
+	return ksym_filter_head.first;
 }
 
 static void *

  reply	other threads:[~2009-11-21 13:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07  5:52 [PATCH 0/8] ksym_tracer: various fixes Li Zefan
2009-07-07  5:52 ` [PATCH 1/8] ksym_tracer: Extract trace entry from struct trace_ksym Li Zefan
2009-07-07 21:25   ` Frederic Weisbecker
2009-07-08  0:55     ` Li Zefan
2009-11-21 13:33   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:52 ` [PATCH 2/8] ksym_tracer: Rewrite ksym_trace_filter_read() Li Zefan
2009-07-07 21:29   ` Frederic Weisbecker
2009-07-11  5:54   ` K.Prasad
2009-11-21 13:34   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:53 ` [PATCH 3/8] ksym_tracer: Fix validation of access type Li Zefan
2009-11-21 13:34   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:53 ` [PATCH 4/8] ksym_tracer: Fix validation of length " Li Zefan
2009-11-21 13:34   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:54 ` [PATCH 5/8] ksym_tracer: NIL-terminate user input filter Li Zefan
2009-11-21 13:34   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:54 ` [PATCH 6/8] ksym_tracer: Report error when failed to re-register hbp Li Zefan
2009-11-21 13:34   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:54 ` [PATCH 7/8] ksym_tracer: Fix memory leak Li Zefan
2009-11-21 13:35   ` [tip:perf/core] " tip-bot for Li Zefan
2009-07-07  5:55 ` [PATCH 8/8] ksym_tracer: Fix the output of stat tracing Li Zefan
2009-11-21 13:35   ` tip-bot for Li Zefan [this message]
2009-07-07 23:18 ` [PATCH 0/8] ksym_tracer: various fixes Frederic Weisbecker
2009-07-10 10:01   ` Ingo Molnar
2009-07-11  5:54   ` K.Prasad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-9d7e934408b52cd53dd85270eb36941a6a318cc5@git.kernel.org \
    --to=lizf@cn.fujitsu.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox