[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <35FD53F367049845BC99AC72306C23D104A310D42373@CNBJMBX05.corpusers.net>
Date: Wed, 18 Mar 2015 10:35:39 +0800
From: "Wang, Yalin" <Yalin.Wang@...ymobile.com>
To: 'David Rientjes' <rientjes@...gle.com>
CC: "'akpm@...ux-foundation.org'" <akpm@...ux-foundation.org>,
"'heiko.carstens@...ibm.com'" <heiko.carstens@...ibm.com>,
"'tglx@...utronix.de'" <tglx@...utronix.de>,
"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>
Subject: [RFC V2] proc: change /proc/stat show
This patch change /proc/stat to show each cpu,
we show each present cpus instead of eacn online cpu,
because some cpus are online / offline dynamically,
we should also show its cputime even it is offline,
some lib will read this file to detect cpu numbers,
we should also return the real present cpu numbers,
not just online cpus.
Signed-off-by: Yalin Wang <yalin.wang@...ymobile.com>
---
fs/proc/stat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 510413eb..f009cdd 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -130,7 +130,7 @@ static int show_stat(struct seq_file *p, void *v)
seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
seq_putc(p, '\n');
- for_each_online_cpu(i) {
+ for_each_present_cpu(i) {
/* Copy values here to work around gcc-2.95.3, gcc-2.96 */
user = kcpustat_cpu(i).cpustat[CPUTIME_USER];
nice = kcpustat_cpu(i).cpustat[CPUTIME_NICE];
--
2.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists