aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 0c6bc602e6c4..4badde179b18 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -322,6 +322,8 @@ static inline void task_context_switch_counts(struct seq_file *m,
322 p->nivcsw); 322 p->nivcsw);
323} 323}
324 324
325#ifdef CONFIG_MMU
326
325struct stack_stats { 327struct stack_stats {
326 struct vm_area_struct *vma; 328 struct vm_area_struct *vma;
327 unsigned long startpage; 329 unsigned long startpage;
@@ -402,6 +404,21 @@ static inline void task_show_stack_usage(struct seq_file *m,
402 mmput(mm); 404 mmput(mm);
403 } 405 }
404} 406}
407#else
408static void task_show_stack_usage(struct seq_file *m, struct task_struct *task)
409{
410}
411#endif /* CONFIG_MMU */
412
413static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
414{
415 seq_printf(m, "Cpus_allowed:\t");
416 seq_cpumask(m, &task->cpus_allowed);
417 seq_printf(m, "\n");
418 seq_printf(m, "Cpus_allowed_list:\t");
419 seq_cpumask_list(m, &task->cpus_allowed);
420 seq_printf(m, "\n");
421}
405 422
406int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, 423int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
407 struct pid *pid, struct task_struct *task) 424 struct pid *pid, struct task_struct *task)
@@ -417,6 +434,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
417 } 434 }
418 task_sig(m, task); 435 task_sig(m, task);
419 task_cap(m, task); 436 task_cap(m, task);
437 task_cpus_allowed(m, task);
420 cpuset_task_status_allowed(m, task); 438 cpuset_task_status_allowed(m, task);
421#if defined(CONFIG_S390) 439#if defined(CONFIG_S390)
422 task_show_regs(m, task); 440 task_show_regs(m, task);
@@ -488,20 +506,17 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
488 506
489 /* add up live thread stats at the group level */ 507 /* add up live thread stats at the group level */
490 if (whole) { 508 if (whole) {
491 struct task_cputime cputime;
492 struct task_struct *t = task; 509 struct task_struct *t = task;
493 do { 510 do {
494 min_flt += t->min_flt; 511 min_flt += t->min_flt;
495 maj_flt += t->maj_flt; 512 maj_flt += t->maj_flt;
496 gtime = cputime_add(gtime, task_gtime(t)); 513 gtime = cputime_add(gtime, t->gtime);
497 t = next_thread(t); 514 t = next_thread(t);
498 } while (t != task); 515 } while (t != task);
499 516
500 min_flt += sig->min_flt; 517 min_flt += sig->min_flt;
501 maj_flt += sig->maj_flt; 518 maj_flt += sig->maj_flt;
502 thread_group_cputime(task, &cputime); 519 thread_group_times(task, &utime, &stime);
503 utime = cputime.utime;
504 stime = cputime.stime;
505 gtime = cputime_add(gtime, sig->gtime); 520 gtime = cputime_add(gtime, sig->gtime);
506 } 521 }
507 522
@@ -517,9 +532,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
517 if (!whole) { 532 if (!whole) {
518 min_flt = task->min_flt; 533 min_flt = task->min_flt;
519 maj_flt = task->maj_flt; 534 maj_flt = task->maj_flt;
520 utime = task_utime(task); 535 task_times(task, &utime, &stime);
521 stime = task_stime(task); 536 gtime = task->gtime;
522 gtime = task_gtime(task);
523 } 537 }
524 538
525 /* scale priority and nice values from timeslices to -20..20 */ 539 /* scale priority and nice values from timeslices to -20..20 */
@@ -564,7 +578,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
564 rsslim, 578 rsslim,
565 mm ? mm->start_code : 0, 579 mm ? mm->start_code : 0,
566 mm ? mm->end_code : 0, 580 mm ? mm->end_code : 0,
567 (permitted) ? task->stack_start : 0, 581 (permitted && mm) ? task->stack_start : 0,
568 esp, 582 esp,
569 eip, 583 eip,
570 /* The signal information here is obsolete. 584 /* The signal information here is obsolete.