aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/stat.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2016-10-07 20:02:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:30 -0400
commit75ba1d07fd6a494851db5132612944a9d4773f9c (patch)
tree7a4d91412f3beefe884b3ef8cac536d304d66fa9 /fs/proc/stat.c
parentf7a5f132b447cb6301ab3f0b0468a63db29e41f5 (diff)
seq/proc: modify seq_put_decimal_[u]ll to take a const char *, not char
Allow some seq_puts removals by taking a string instead of a single char. [akpm@linux-foundation.org: update vmstat_show(), per Joe] Link: http://lkml.kernel.org/r/667e1cf3d436de91a5698170a1e98d882905e956.1470704995.git.joe@perches.com Signed-off-by: Joe Perches <joe@perches.com> Cc: Joe Perches <joe@perches.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r--fs/proc/stat.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 7907e456ac4f..d700c42b3572 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -115,17 +115,16 @@ static int show_stat(struct seq_file *p, void *v)
115 } 115 }
116 sum += arch_irq_stat(); 116 sum += arch_irq_stat();
117 117
118 seq_puts(p, "cpu "); 118 seq_put_decimal_ull(p, "cpu ", cputime64_to_clock_t(user));
119 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(user)); 119 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(nice));
120 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(nice)); 120 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(system));
121 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(system)); 121 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(idle));
122 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(idle)); 122 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(iowait));
123 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(iowait)); 123 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(irq));
124 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(irq)); 124 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(softirq));
125 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(softirq)); 125 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(steal));
126 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(steal)); 126 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(guest));
127 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest)); 127 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(guest_nice));
128 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
129 seq_putc(p, '\n'); 128 seq_putc(p, '\n');
130 129
131 for_each_online_cpu(i) { 130 for_each_online_cpu(i) {
@@ -141,23 +140,23 @@ static int show_stat(struct seq_file *p, void *v)
141 guest = kcpustat_cpu(i).cpustat[CPUTIME_GUEST]; 140 guest = kcpustat_cpu(i).cpustat[CPUTIME_GUEST];
142 guest_nice = kcpustat_cpu(i).cpustat[CPUTIME_GUEST_NICE]; 141 guest_nice = kcpustat_cpu(i).cpustat[CPUTIME_GUEST_NICE];
143 seq_printf(p, "cpu%d", i); 142 seq_printf(p, "cpu%d", i);
144 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(user)); 143 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(user));
145 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(nice)); 144 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(nice));
146 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(system)); 145 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(system));
147 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(idle)); 146 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(idle));
148 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(iowait)); 147 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(iowait));
149 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(irq)); 148 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(irq));
150 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(softirq)); 149 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(softirq));
151 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(steal)); 150 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(steal));
152 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest)); 151 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(guest));
153 seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice)); 152 seq_put_decimal_ull(p, " ", cputime64_to_clock_t(guest_nice));
154 seq_putc(p, '\n'); 153 seq_putc(p, '\n');
155 } 154 }
156 seq_printf(p, "intr %llu", (unsigned long long)sum); 155 seq_put_decimal_ull(p, "intr ", (unsigned long long)sum);
157 156
158 /* sum again ? it could be updated? */ 157 /* sum again ? it could be updated? */
159 for_each_irq_nr(j) 158 for_each_irq_nr(j)
160 seq_put_decimal_ull(p, ' ', kstat_irqs_usr(j)); 159 seq_put_decimal_ull(p, " ", kstat_irqs_usr(j));
161 160
162 seq_printf(p, 161 seq_printf(p,
163 "\nctxt %llu\n" 162 "\nctxt %llu\n"
@@ -171,10 +170,10 @@ static int show_stat(struct seq_file *p, void *v)
171 nr_running(), 170 nr_running(),
172 nr_iowait()); 171 nr_iowait());
173 172
174 seq_printf(p, "softirq %llu", (unsigned long long)sum_softirq); 173 seq_put_decimal_ull(p, "softirq ", (unsigned long long)sum_softirq);
175 174
176 for (i = 0; i < NR_SOFTIRQS; i++) 175 for (i = 0; i < NR_SOFTIRQS; i++)
177 seq_put_decimal_ull(p, ' ', per_softirq_sums[i]); 176 seq_put_decimal_ull(p, " ", per_softirq_sums[i]);
178 seq_putc(p, '\n'); 177 seq_putc(p, '\n');
179 178
180 return 0; 179 return 0;