aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c53
1 files changed, 12 insertions, 41 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b20962c71a5..93f1cdd5d3d 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -373,26 +373,20 @@ static int lstats_show_proc(struct seq_file *m, void *v)
373 return -ESRCH; 373 return -ESRCH;
374 seq_puts(m, "Latency Top version : v0.1\n"); 374 seq_puts(m, "Latency Top version : v0.1\n");
375 for (i = 0; i < 32; i++) { 375 for (i = 0; i < 32; i++) {
376 if (task->latency_record[i].backtrace[0]) { 376 struct latency_record *lr = &task->latency_record[i];
377 if (lr->backtrace[0]) {
377 int q; 378 int q;
378 seq_printf(m, "%i %li %li ", 379 seq_printf(m, "%i %li %li",
379 task->latency_record[i].count, 380 lr->count, lr->time, lr->max);
380 task->latency_record[i].time,
381 task->latency_record[i].max);
382 for (q = 0; q < LT_BACKTRACEDEPTH; q++) { 381 for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
383 char sym[KSYM_SYMBOL_LEN]; 382 unsigned long bt = lr->backtrace[q];
384 char *c; 383 if (!bt)
385 if (!task->latency_record[i].backtrace[q])
386 break; 384 break;
387 if (task->latency_record[i].backtrace[q] == ULONG_MAX) 385 if (bt == ULONG_MAX)
388 break; 386 break;
389 sprint_symbol(sym, task->latency_record[i].backtrace[q]); 387 seq_printf(m, " %ps", (void *)bt);
390 c = strchr(sym, '+');
391 if (c)
392 *c = 0;
393 seq_printf(m, "%s ", sym);
394 } 388 }
395 seq_printf(m, "\n"); 389 seq_putc(m, '\n');
396 } 390 }
397 391
398 } 392 }
@@ -751,14 +745,7 @@ static int proc_single_show(struct seq_file *m, void *v)
751 745
752static int proc_single_open(struct inode *inode, struct file *filp) 746static int proc_single_open(struct inode *inode, struct file *filp)
753{ 747{
754 int ret; 748 return single_open(filp, proc_single_show, inode);
755 ret = single_open(filp, proc_single_show, NULL);
756 if (!ret) {
757 struct seq_file *m = filp->private_data;
758
759 m->private = inode;
760 }
761 return ret;
762} 749}
763 750
764static const struct file_operations proc_single_file_operations = { 751static const struct file_operations proc_single_file_operations = {
@@ -1386,15 +1373,7 @@ sched_write(struct file *file, const char __user *buf,
1386 1373
1387static int sched_open(struct inode *inode, struct file *filp) 1374static int sched_open(struct inode *inode, struct file *filp)
1388{ 1375{
1389 int ret; 1376 return single_open(filp, sched_show, inode);
1390
1391 ret = single_open(filp, sched_show, NULL);
1392 if (!ret) {
1393 struct seq_file *m = filp->private_data;
1394
1395 m->private = inode;
1396 }
1397 return ret;
1398} 1377}
1399 1378
1400static const struct file_operations proc_pid_sched_operations = { 1379static const struct file_operations proc_pid_sched_operations = {
@@ -1530,15 +1509,7 @@ static int comm_show(struct seq_file *m, void *v)
1530 1509
1531static int comm_open(struct inode *inode, struct file *filp) 1510static int comm_open(struct inode *inode, struct file *filp)
1532{ 1511{
1533 int ret; 1512 return single_open(filp, comm_show, inode);
1534
1535 ret = single_open(filp, comm_show, NULL);
1536 if (!ret) {
1537 struct seq_file *m = filp->private_data;
1538
1539 m->private = inode;
1540 }
1541 return ret;
1542} 1513}
1543 1514
1544static const struct file_operations proc_pid_set_comm_operations = { 1515static const struct file_operations proc_pid_set_comm_operations = {