aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/stat.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 81904f07679d..a13431ab7c65 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -27,6 +27,7 @@ static int show_stat(struct seq_file *p, void *v)
27 u64 sum = 0; 27 u64 sum = 0;
28 struct timespec boottime; 28 struct timespec boottime;
29 unsigned int per_irq_sum; 29 unsigned int per_irq_sum;
30 struct irq_desc *desc;
30 31
31 user = nice = system = idle = iowait = 32 user = nice = system = idle = iowait =
32 irq = softirq = steal = cputime64_zero; 33 irq = softirq = steal = cputime64_zero;
@@ -44,10 +45,11 @@ static int show_stat(struct seq_file *p, void *v)
44 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); 45 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
45 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); 46 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
46 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); 47 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
47 48 for_each_irq_desc(j, desc) {
48 for_each_irq_nr(j) 49 if (!desc)
50 continue;
49 sum += kstat_irqs_cpu(j, i); 51 sum += kstat_irqs_cpu(j, i);
50 52 }
51 sum += arch_irq_stat_cpu(i); 53 sum += arch_irq_stat_cpu(i);
52 } 54 }
53 sum += arch_irq_stat(); 55 sum += arch_irq_stat();
@@ -90,11 +92,14 @@ static int show_stat(struct seq_file *p, void *v)
90 seq_printf(p, "intr %llu", (unsigned long long)sum); 92 seq_printf(p, "intr %llu", (unsigned long long)sum);
91 93
92 /* sum again ? it could be updated? */ 94 /* sum again ? it could be updated? */
93 for_each_irq_nr(j) { 95 for (j = 0; j < NR_IRQS; j++) {
96 desc = irq_to_desc(j);
94 per_irq_sum = 0; 97 per_irq_sum = 0;
95 98
96 for_each_possible_cpu(i) 99 if (desc) {
97 per_irq_sum += kstat_irqs_cpu(j, i); 100 for_each_possible_cpu(i)
101 per_irq_sum += kstat_irqs_cpu(j, i);
102 }
98 103
99 seq_printf(p, " %u", per_irq_sum); 104 seq_printf(p, " %u", per_irq_sum);
100 } 105 }