mirror of https://gitee.com/openkylin/linux.git
fs/proc/base.c, kernel/latencytop.c: convert sprintf_symbol() to %ps
Use temporary lr for struct latency_record for improved readability and fewer columns used. Removed trailing space from output. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Joe Perches <joe@perches.com> Cc: Jiri Kosina <trivial@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
1bdcd78e24
commit
34e49d4f63
|
@ -373,24 +373,18 @@ static int lstats_show_proc(struct seq_file *m, void *v)
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
seq_puts(m, "Latency Top version : v0.1\n");
|
seq_puts(m, "Latency Top version : v0.1\n");
|
||||||
for (i = 0; i < 32; i++) {
|
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;
|
int q;
|
||||||
seq_printf(m, "%i %li %li ",
|
seq_printf(m, "%i %li %li",
|
||||||
task->latency_record[i].count,
|
lr->count, lr->time, lr->max);
|
||||||
task->latency_record[i].time,
|
|
||||||
task->latency_record[i].max);
|
|
||||||
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
|
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
|
||||||
char sym[KSYM_SYMBOL_LEN];
|
unsigned long bt = lr->backtrace[q];
|
||||||
char *c;
|
if (!bt)
|
||||||
if (!task->latency_record[i].backtrace[q])
|
|
||||||
break;
|
break;
|
||||||
if (task->latency_record[i].backtrace[q] == ULONG_MAX)
|
if (bt == ULONG_MAX)
|
||||||
break;
|
break;
|
||||||
sprint_symbol(sym, task->latency_record[i].backtrace[q]);
|
seq_printf(m, " %ps", (void *)bt);
|
||||||
c = strchr(sym, '+');
|
|
||||||
if (c)
|
|
||||||
*c = 0;
|
|
||||||
seq_printf(m, "%s ", sym);
|
|
||||||
}
|
}
|
||||||
seq_printf(m, "\n");
|
seq_printf(m, "\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,24 +241,19 @@ static int lstats_show(struct seq_file *m, void *v)
|
||||||
seq_puts(m, "Latency Top version : v0.1\n");
|
seq_puts(m, "Latency Top version : v0.1\n");
|
||||||
|
|
||||||
for (i = 0; i < MAXLR; i++) {
|
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;
|
int q;
|
||||||
seq_printf(m, "%i %lu %lu ",
|
seq_printf(m, "%i %lu %lu",
|
||||||
latency_record[i].count,
|
lr->count, lr->time, lr->max);
|
||||||
latency_record[i].time,
|
|
||||||
latency_record[i].max);
|
|
||||||
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
|
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
|
||||||
char sym[KSYM_SYMBOL_LEN];
|
unsigned long bt = lr->backtrace[q];
|
||||||
char *c;
|
if (!bt)
|
||||||
if (!latency_record[i].backtrace[q])
|
|
||||||
break;
|
break;
|
||||||
if (latency_record[i].backtrace[q] == ULONG_MAX)
|
if (bt == ULONG_MAX)
|
||||||
break;
|
break;
|
||||||
sprint_symbol(sym, latency_record[i].backtrace[q]);
|
seq_printf(m, " %ps", (void *)bt);
|
||||||
c = strchr(sym, '+');
|
|
||||||
if (c)
|
|
||||||
*c = 0;
|
|
||||||
seq_printf(m, "%s ", sym);
|
|
||||||
}
|
}
|
||||||
seq_printf(m, "\n");
|
seq_printf(m, "\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue