diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-10-21 14:42:20 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-10-21 14:42:20 -0400 |
commit | b876d08f816527af257e13d89fb0d3b4b849223c (patch) | |
tree | 40569f568230f918ca55f04b355e251747f913ed /fs/proc | |
parent | b364776ad1208a71f0c53578c84619a395412a8d (diff) | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/pci/dmar.c
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/array.c | 8 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 40 |
2 files changed, 23 insertions, 25 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index f4bc0e789539..bb9f4b05703d 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -388,20 +388,20 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
388 | 388 | ||
389 | /* add up live thread stats at the group level */ | 389 | /* add up live thread stats at the group level */ |
390 | if (whole) { | 390 | if (whole) { |
391 | struct task_cputime cputime; | ||
391 | struct task_struct *t = task; | 392 | struct task_struct *t = task; |
392 | do { | 393 | do { |
393 | min_flt += t->min_flt; | 394 | min_flt += t->min_flt; |
394 | maj_flt += t->maj_flt; | 395 | maj_flt += t->maj_flt; |
395 | utime = cputime_add(utime, task_utime(t)); | ||
396 | stime = cputime_add(stime, task_stime(t)); | ||
397 | gtime = cputime_add(gtime, task_gtime(t)); | 396 | gtime = cputime_add(gtime, task_gtime(t)); |
398 | t = next_thread(t); | 397 | t = next_thread(t); |
399 | } while (t != task); | 398 | } while (t != task); |
400 | 399 | ||
401 | min_flt += sig->min_flt; | 400 | min_flt += sig->min_flt; |
402 | maj_flt += sig->maj_flt; | 401 | maj_flt += sig->maj_flt; |
403 | utime = cputime_add(utime, sig->utime); | 402 | thread_group_cputime(task, &cputime); |
404 | stime = cputime_add(stime, sig->stime); | 403 | utime = cputime.utime; |
404 | stime = cputime.stime; | ||
405 | gtime = cputime_add(gtime, sig->gtime); | 405 | gtime = cputime_add(gtime, sig->gtime); |
406 | } | 406 | } |
407 | 407 | ||
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 61b25f4eabe6..7ea52c79b2da 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
31 | #include <linux/mmzone.h> | 31 | #include <linux/mmzone.h> |
32 | #include <linux/pagemap.h> | 32 | #include <linux/pagemap.h> |
33 | #include <linux/irq.h> | ||
33 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
34 | #include <linux/swap.h> | 35 | #include <linux/swap.h> |
35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
@@ -521,17 +522,13 @@ static const struct file_operations proc_vmalloc_operations = { | |||
521 | 522 | ||
522 | static int show_stat(struct seq_file *p, void *v) | 523 | static int show_stat(struct seq_file *p, void *v) |
523 | { | 524 | { |
524 | int i; | 525 | int i, j; |
525 | unsigned long jif; | 526 | unsigned long jif; |
526 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; | 527 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; |
527 | cputime64_t guest; | 528 | cputime64_t guest; |
528 | u64 sum = 0; | 529 | u64 sum = 0; |
529 | struct timespec boottime; | 530 | struct timespec boottime; |
530 | unsigned int *per_irq_sum; | 531 | unsigned int per_irq_sum; |
531 | |||
532 | per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL); | ||
533 | if (!per_irq_sum) | ||
534 | return -ENOMEM; | ||
535 | 532 | ||
536 | user = nice = system = idle = iowait = | 533 | user = nice = system = idle = iowait = |
537 | irq = softirq = steal = cputime64_zero; | 534 | irq = softirq = steal = cputime64_zero; |
@@ -540,8 +537,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
540 | jif = boottime.tv_sec; | 537 | jif = boottime.tv_sec; |
541 | 538 | ||
542 | for_each_possible_cpu(i) { | 539 | for_each_possible_cpu(i) { |
543 | int j; | ||
544 | |||
545 | user = cputime64_add(user, kstat_cpu(i).cpustat.user); | 540 | user = cputime64_add(user, kstat_cpu(i).cpustat.user); |
546 | nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); | 541 | nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); |
547 | system = cputime64_add(system, kstat_cpu(i).cpustat.system); | 542 | system = cputime64_add(system, kstat_cpu(i).cpustat.system); |
@@ -551,11 +546,10 @@ static int show_stat(struct seq_file *p, void *v) | |||
551 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); | 546 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); |
552 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 547 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
553 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 548 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
554 | for (j = 0; j < NR_IRQS; j++) { | 549 | |
555 | unsigned int temp = kstat_cpu(i).irqs[j]; | 550 | for_each_irq_nr(j) |
556 | sum += temp; | 551 | sum += kstat_irqs_cpu(j, i); |
557 | per_irq_sum[j] += temp; | 552 | |
558 | } | ||
559 | sum += arch_irq_stat_cpu(i); | 553 | sum += arch_irq_stat_cpu(i); |
560 | } | 554 | } |
561 | sum += arch_irq_stat(); | 555 | sum += arch_irq_stat(); |
@@ -597,8 +591,15 @@ static int show_stat(struct seq_file *p, void *v) | |||
597 | } | 591 | } |
598 | seq_printf(p, "intr %llu", (unsigned long long)sum); | 592 | seq_printf(p, "intr %llu", (unsigned long long)sum); |
599 | 593 | ||
600 | for (i = 0; i < NR_IRQS; i++) | 594 | /* sum again ? it could be updated? */ |
601 | seq_printf(p, " %u", per_irq_sum[i]); | 595 | for_each_irq_nr(j) { |
596 | per_irq_sum = 0; | ||
597 | |||
598 | for_each_possible_cpu(i) | ||
599 | per_irq_sum += kstat_irqs_cpu(j, i); | ||
600 | |||
601 | seq_printf(p, " %u", per_irq_sum); | ||
602 | } | ||
602 | 603 | ||
603 | seq_printf(p, | 604 | seq_printf(p, |
604 | "\nctxt %llu\n" | 605 | "\nctxt %llu\n" |
@@ -612,7 +613,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
612 | nr_running(), | 613 | nr_running(), |
613 | nr_iowait()); | 614 | nr_iowait()); |
614 | 615 | ||
615 | kfree(per_irq_sum); | ||
616 | return 0; | 616 | return 0; |
617 | } | 617 | } |
618 | 618 | ||
@@ -651,15 +651,14 @@ static const struct file_operations proc_stat_operations = { | |||
651 | */ | 651 | */ |
652 | static void *int_seq_start(struct seq_file *f, loff_t *pos) | 652 | static void *int_seq_start(struct seq_file *f, loff_t *pos) |
653 | { | 653 | { |
654 | return (*pos <= NR_IRQS) ? pos : NULL; | 654 | return (*pos <= nr_irqs) ? pos : NULL; |
655 | } | 655 | } |
656 | 656 | ||
657 | |||
657 | static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) | 658 | static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) |
658 | { | 659 | { |
659 | (*pos)++; | 660 | (*pos)++; |
660 | if (*pos > NR_IRQS) | 661 | return (*pos <= nr_irqs) ? pos : NULL; |
661 | return NULL; | ||
662 | return pos; | ||
663 | } | 662 | } |
664 | 663 | ||
665 | static void int_seq_stop(struct seq_file *f, void *v) | 664 | static void int_seq_stop(struct seq_file *f, void *v) |
@@ -667,7 +666,6 @@ static void int_seq_stop(struct seq_file *f, void *v) | |||
667 | /* Nothing to do */ | 666 | /* Nothing to do */ |
668 | } | 667 | } |
669 | 668 | ||
670 | |||
671 | static const struct seq_operations int_seq_ops = { | 669 | static const struct seq_operations int_seq_ops = { |
672 | .start = int_seq_start, | 670 | .start = int_seq_start, |
673 | .next = int_seq_next, | 671 | .next = int_seq_next, |