aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r--fs/proc/stat.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 535eda7857cf..76175211b304 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -79,6 +79,31 @@ static u64 get_iowait_time(int cpu)
79 79
80#endif 80#endif
81 81
82static void show_irq_gap(struct seq_file *p, unsigned int gap)
83{
84 static const char zeros[] = " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0";
85
86 while (gap > 0) {
87 unsigned int inc;
88
89 inc = min_t(unsigned int, gap, ARRAY_SIZE(zeros) / 2);
90 seq_write(p, zeros, 2 * inc);
91 gap -= inc;
92 }
93}
94
95static void show_all_irqs(struct seq_file *p)
96{
97 unsigned int i, next = 0;
98
99 for_each_active_irq(i) {
100 show_irq_gap(p, i - next);
101 seq_put_decimal_ull(p, " ", kstat_irqs_usr(i));
102 next = i + 1;
103 }
104 show_irq_gap(p, nr_irqs - next);
105}
106
82static int show_stat(struct seq_file *p, void *v) 107static int show_stat(struct seq_file *p, void *v)
83{ 108{
84 int i, j; 109 int i, j;
@@ -156,9 +181,7 @@ static int show_stat(struct seq_file *p, void *v)
156 } 181 }
157 seq_put_decimal_ull(p, "intr ", (unsigned long long)sum); 182 seq_put_decimal_ull(p, "intr ", (unsigned long long)sum);
158 183
159 /* sum again ? it could be updated? */ 184 show_all_irqs(p);
160 for_each_irq_nr(j)
161 seq_put_decimal_ull(p, " ", kstat_irqs_usr(j));
162 185
163 seq_printf(p, 186 seq_printf(p,
164 "\nctxt %llu\n" 187 "\nctxt %llu\n"