From: Joe Perches <joe@perches.com>
To: Jiri Kosina <trivial@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/7] fs/proc/base.c kernel/latencytop.c: Convert sprintf_symbol to %ps
Date: Fri, 5 Nov 2010 16:12:37 -0700 [thread overview]
Message-ID: <1288998760-11775-5-git-send-email-joe@perches.com> (raw)
In-Reply-To: <1288998760-11775-1-git-send-email-joe@perches.com>
Use temporary lr for struct latency_record for improved readability
and fewer columns used. Removed trailing space from output.
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/proc/base.c | 22 ++++++++--------------
kernel/latencytop.c | 23 +++++++++--------------
2 files changed, 17 insertions(+), 28 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index f3d02ca..1e0cbf4 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -373,24 +373,18 @@ static int lstats_show_proc(struct seq_file *m, void *v)
return -ESRCH;
seq_puts(m, "Latency Top version : v0.1\n");
for (i = 0; i < 32; i++) {
- if (task->latency_record[i].backtrace[0]) {
+ struct latency_record *lr = &task->latency_record[i];
+ if (lr->backtrace[0]) {
int q;
- seq_printf(m, "%i %li %li ",
- task->latency_record[i].count,
- task->latency_record[i].time,
- task->latency_record[i].max);
+ seq_printf(m, "%i %li %li",
+ lr->count, lr->time, lr->max);
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
- char sym[KSYM_SYMBOL_LEN];
- char *c;
- if (!task->latency_record[i].backtrace[q])
+ unsigned long bt = lr->backtrace[q];
+ if (!bt)
break;
- if (task->latency_record[i].backtrace[q] == ULONG_MAX)
+ if (bt == ULONG_MAX)
break;
- sprint_symbol(sym, task->latency_record[i].backtrace[q]);
- c = strchr(sym, '+');
- if (c)
- *c = 0;
- seq_printf(m, "%s ", sym);
+ seq_printf(m, " %ps", (void *)bt);
}
seq_printf(m, "\n");
}
diff --git a/kernel/latencytop.c b/kernel/latencytop.c
index 877fb30..7cbbf5c 100644
--- a/kernel/latencytop.c
+++ b/kernel/latencytop.c
@@ -242,24 +242,19 @@ static int lstats_show(struct seq_file *m, void *v)
seq_puts(m, "Latency Top version : v0.1\n");
for (i = 0; i < MAXLR; i++) {
- if (latency_record[i].backtrace[0]) {
+ struct latency_record *lr = &latency_record[i];
+
+ if (lr->backtrace[0]) {
int q;
- seq_printf(m, "%i %lu %lu ",
- latency_record[i].count,
- latency_record[i].time,
- latency_record[i].max);
+ seq_printf(m, "%i %lu %lu",
+ lr->count, lr->time, lr->max);
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
- char sym[KSYM_SYMBOL_LEN];
- char *c;
- if (!latency_record[i].backtrace[q])
+ unsigned long bt = lr->backtrace[q];
+ if (!bt)
break;
- if (latency_record[i].backtrace[q] == ULONG_MAX)
+ if (bt == ULONG_MAX)
break;
- sprint_symbol(sym, latency_record[i].backtrace[q]);
- c = strchr(sym, '+');
- if (c)
- *c = 0;
- seq_printf(m, "%s ", sym);
+ seq_printf(m, " %ps", (void *)bt);
}
seq_printf(m, "\n");
}
--
1.7.3.2.146.gca209
next prev parent reply other threads:[~2010-11-05 23:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 23:12 [PATCH 0/7] Convert sprintf_symbol uses to %p[Ss] Joe Perches
2010-11-05 23:12 ` [PATCH 1/7] arch/arm/kernel/traps.c: Convert sprintf_symbol to %pS Joe Perches
2010-11-05 23:12 ` [PATCH 2/7] arch/x86/kernel/pci-iommu_table.c: " Joe Perches
2010-11-10 15:48 ` Joerg Roedel
2010-11-05 23:12 ` [PATCH 3/7] fs/gfs2/glock.c: " Joe Perches
2010-11-08 10:26 ` Steven Whitehouse
2010-11-05 23:12 ` Joe Perches [this message]
2010-11-05 23:12 ` [PATCH 5/7] kernel/lockdep_proc.c: " Joe Perches
2010-11-05 23:12 ` [PATCH 6/7] mm: " Joe Perches
2010-11-06 15:00 ` Pekka Enberg
2010-11-05 23:12 ` [PATCH 7/7] net/sunrpc/clnt.c: Convert sprintf_symbol to %ps Joe Perches
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=1288998760-11775-5-git-send-email-joe@perches.com \
--to=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@kernel.org \
/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
Powered by JetHome