From: "Wang, Yalin" <Yalin.Wang@sonymobile.com>
To: "'David Rientjes'" <rientjes@google.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"heiko.carstens@de.ibm.com" <heiko.carstens@de.ibm.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RFC] proc: change /proc/stat show
Date: Wed, 18 Mar 2015 09:55:48 +0800 [thread overview]
Message-ID: <35FD53F367049845BC99AC72306C23D104A310D42372@CNBJMBX05.corpusers.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1503171601230.11185@chino.kir.corp.google.com>
> -----Original Message-----
> From: David Rientjes [mailto:rientjes@google.com]
> Sent: Wednesday, March 18, 2015 7:02 AM
> To: Wang, Yalin
> Cc: akpm@linux-foundation.org; heiko.carstens@de.ibm.com;
> tglx@linutronix.de; linux-kernel@vger.kernel.org
> Subject: Re: [RFC] proc: change /proc/stat show
>
> On Tue, 17 Mar 2015, Wang, Yalin wrote:
>
> > diff --git a/fs/proc/stat.c b/fs/proc/stat.c
> > index 510413eb..60b39e2 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];
> > @@ -153,6 +153,7 @@ static int show_stat(struct seq_file *p, void *v)
> > seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(steal));
> > seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest));
> > seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
> > + seq_printf(p, " %d", cpu_online(i)? 1 : 0);
> > seq_putc(p, '\n');
> > }
> > seq_printf(p, "intr %llu", (unsigned long long)sum);
>
> Makes sense, but why do we need to output the cpu state as part of
> /proc/stat? This information should already be available elsewhere.
Yeah, online / offline info can be read from /sys/devices/cpu .
I can remove this line , if you think it is not needed .
Thanks
next prev parent reply other threads:[~2015-03-18 1:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 9:42 Wang, Yalin
2015-03-17 23:02 ` David Rientjes
2015-03-18 1:55 ` Wang, Yalin [this message]
2015-03-18 2:35 ` [RFC V2] " Wang, Yalin
2015-03-18 22:07 ` Andrew Morton
2015-03-19 7:18 ` Wang, Yalin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35FD53F367049845BC99AC72306C23D104A310D42372@CNBJMBX05.corpusers.net \
--to=yalin.wang@sonymobile.com \
--cc=akpm@linux-foundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®