From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: make app read out process num even not use SMP
Date: Sun, 19 Sep 2010 14:04:38 +0100 [thread overview]
Message-ID: <20100919130438.GC9098@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20100919122920.GB9098@n2100.arm.linux.org.uk>
On Sun, Sep 19, 2010 at 01:29:20PM +0100, Russell King - ARM Linux wrote:
> On Sun, Sep 19, 2010 at 11:22:16AM +0800, Lei Wen wrote:
> > Some app like trace-cmd need to know the process number, but not
>
> That'll be "processor number".
>
> > all arm board is enabled with the SMP. Add this fix up to let those
> > app works happy.
>
> We have historically never given the "processor: 0" line on uniprocessor
> systems - and many other architectures do not provide this line either.
>
> I'd suggest trace-cmd is fixed so that it doesn't assume presence of this
> line.
Ah, trace-cmd is using it to get the number of CPUs in the system.
This is silly, and it's unreliable to use /proc/cpuinfo as noted in
the glibc source code.
There's a better way. sysconf with _SC_NPROCESSORS_CONF for the number
of configured processors, or _SC_NPROCESSORS_ONLN for the number of
online processors. Standard interfaces are always better than home-made
interfaces.
next prev parent reply other threads:[~2010-09-19 13:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 3:22 [PATCH] ARM: make app read out process num even not use SMP Lei Wen
2010-09-19 11:51 ` Sergei Shtylyov
2010-09-19 12:29 ` Russell King - ARM Linux
2010-09-19 13:04 ` Russell King - ARM Linux [this message]
2010-09-19 16:35 ` Steven Rostedt
2010-09-20 16:52 ` Steven Rostedt
2010-09-19 13:05 ` Steven Rostedt
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=20100919130438.GC9098@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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