diff options
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r-- | fs/proc/stat.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 81904f07679d..3cb9492801c0 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,14 @@ 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_nr(j) { | |
48 | for_each_irq_nr(j) | 49 | #ifdef CONFIG_SPARSE_IRQ |
50 | desc = irq_to_desc(j); | ||
51 | if (!desc) | ||
52 | continue; | ||
53 | #endif | ||
49 | sum += kstat_irqs_cpu(j, i); | 54 | sum += kstat_irqs_cpu(j, i); |
50 | 55 | } | |
51 | sum += arch_irq_stat_cpu(i); | 56 | sum += arch_irq_stat_cpu(i); |
52 | } | 57 | } |
53 | sum += arch_irq_stat(); | 58 | sum += arch_irq_stat(); |
@@ -92,7 +97,13 @@ static int show_stat(struct seq_file *p, void *v) | |||
92 | /* sum again ? it could be updated? */ | 97 | /* sum again ? it could be updated? */ |
93 | for_each_irq_nr(j) { | 98 | for_each_irq_nr(j) { |
94 | per_irq_sum = 0; | 99 | per_irq_sum = 0; |
95 | 100 | #ifdef CONFIG_SPARSE_IRQ | |
101 | desc = irq_to_desc(j); | ||
102 | if (!desc) { | ||
103 | seq_printf(p, " %u", per_irq_sum); | ||
104 | continue; | ||
105 | } | ||
106 | #endif | ||
96 | for_each_possible_cpu(i) | 107 | for_each_possible_cpu(i) |
97 | per_irq_sum += kstat_irqs_cpu(j, i); | 108 | per_irq_sum += kstat_irqs_cpu(j, i); |
98 | 109 | ||