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.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 87ba007b86db..b6ccb6c57706 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -407,7 +407,6 @@ static void unlock_trace(struct task_struct *task)
407static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns, 407static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
408 struct pid *pid, struct task_struct *task) 408 struct pid *pid, struct task_struct *task)
409{ 409{
410 struct stack_trace trace;
411 unsigned long *entries; 410 unsigned long *entries;
412 int err; 411 int err;
413 412
@@ -430,20 +429,17 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
430 if (!entries) 429 if (!entries)
431 return -ENOMEM; 430 return -ENOMEM;
432 431
433 trace.nr_entries = 0;
434 trace.max_entries = MAX_STACK_TRACE_DEPTH;
435 trace.entries = entries;
436 trace.skip = 0;
437
438 err = lock_trace(task); 432 err = lock_trace(task);
439 if (!err) { 433 if (!err) {
440 unsigned int i; 434 unsigned int i, nr_entries;
441 435
442 save_stack_trace_tsk(task, &trace); 436 nr_entries = stack_trace_save_tsk(task, entries,
437 MAX_STACK_TRACE_DEPTH, 0);
443 438
444 for (i = 0; i < trace.nr_entries; i++) { 439 for (i = 0; i < nr_entries; i++) {
445 seq_printf(m, "[<0>] %pB\n", (void *)entries[i]); 440 seq_printf(m, "[<0>] %pB\n", (void *)entries[i]);
446 } 441 }
442
447 unlock_trace(task); 443 unlock_trace(task);
448 } 444 }
449 kfree(entries); 445 kfree(entries);
@@ -489,10 +485,9 @@ static int lstats_show_proc(struct seq_file *m, void *v)
489 lr->count, lr->time, lr->max); 485 lr->count, lr->time, lr->max);
490 for (q = 0; q < LT_BACKTRACEDEPTH; q++) { 486 for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
491 unsigned long bt = lr->backtrace[q]; 487 unsigned long bt = lr->backtrace[q];
488
492 if (!bt) 489 if (!bt)
493 break; 490 break;
494 if (bt == ULONG_MAX)
495 break;
496 seq_printf(m, " %ps", (void *)bt); 491 seq_printf(m, " %ps", (void *)bt);
497 } 492 }
498 seq_putc(m, '\n'); 493 seq_putc(m, '\n');
@@ -616,24 +611,25 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns,
616static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns, 611static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
617 struct pid *pid, struct task_struct *task) 612 struct pid *pid, struct task_struct *task)
618{ 613{
619 long nr; 614 struct syscall_info info;
620 unsigned long args[6], sp, pc; 615 u64 *args = &info.data.args[0];
621 int res; 616 int res;
622 617
623 res = lock_trace(task); 618 res = lock_trace(task);
624 if (res) 619 if (res)
625 return res; 620 return res;
626 621
627 if (task_current_syscall(task, &nr, args, 6, &sp, &pc)) 622 if (task_current_syscall(task, &info))
628 seq_puts(m, "running\n"); 623 seq_puts(m, "running\n");
629 else if (nr < 0) 624 else if (info.data.nr < 0)
630 seq_printf(m, "%ld 0x%lx 0x%lx\n", nr, sp, pc); 625 seq_printf(m, "%d 0x%llx 0x%llx\n",
626 info.data.nr, info.sp, info.data.instruction_pointer);
631 else 627 else
632 seq_printf(m, 628 seq_printf(m,
633 "%ld 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n", 629 "%d 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx\n",
634 nr, 630 info.data.nr,
635 args[0], args[1], args[2], args[3], args[4], args[5], 631 args[0], args[1], args[2], args[3], args[4], args[5],
636 sp, pc); 632 info.sp, info.data.instruction_pointer);
637 unlock_trace(task); 633 unlock_trace(task);
638 634
639 return 0; 635 return 0;