public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: make app read out process num even not use SMP
@ 2010-09-19  3:22 Lei Wen
  2010-09-19 11:51 ` Sergei Shtylyov
  2010-09-19 12:29 ` Russell King - ARM Linux
  0 siblings, 2 replies; 7+ messages in thread
From: Lei Wen @ 2010-09-19  3:22 UTC (permalink / raw)
  To: linux-arm-kernel

Some app like trace-cmd need to know the process number, but not
all arm board is enabled with the SMP. Add this fix up to let those
app works happy.

Signed-off-by: Lei Wen<leiwen@marvell.com>
Signed-off-by: Lei Wen <leiwen@marvell.com>
---
 arch/arm/kernel/setup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index d5231ae..1af3e2d 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -917,6 +917,7 @@ static int c_show(struct seq_file *m, void *v)
 			   (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
 	}
 #else /* CONFIG_SMP */
+	seq_printf(m, "processor\t: 0\n");
 	seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
 		   loops_per_jiffy / (500000/HZ),
 		   (loops_per_jiffy / (5000/HZ)) % 100);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] ARM: make app read out process num even not use SMP
  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
  1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2010-09-19 11:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 19-09-2010 7:22, Lei Wen wrote:

> Some app like trace-cmd need to know the process number, but not
> all arm board is enabled with the SMP. Add this fix up to let those
> app works happy.

> Signed-off-by: Lei Wen<leiwen@marvell.com>
> Signed-off-by: Lei Wen<leiwen@marvell.com>

    One signoff is enough. :-)

WBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: make app read out process num even not use SMP
  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
  2010-09-19 13:05   ` Steven Rostedt
  1 sibling, 2 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2010-09-19 12:29 UTC (permalink / raw)
  To: linux-arm-kernel

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: make app read out process num even not use SMP
  2010-09-19 12:29 ` Russell King - ARM Linux
@ 2010-09-19 13:04   ` Russell King - ARM Linux
  2010-09-19 16:35     ` Steven Rostedt
  2010-09-20 16:52     ` Steven Rostedt
  2010-09-19 13:05   ` Steven Rostedt
  1 sibling, 2 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2010-09-19 13:04 UTC (permalink / raw)
  To: linux-arm-kernel

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: make app read out process num even not use SMP
  2010-09-19 12:29 ` Russell King - ARM Linux
  2010-09-19 13:04   ` Russell King - ARM Linux
@ 2010-09-19 13:05   ` Steven Rostedt
  1 sibling, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2010-09-19 13:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2010-09-19 at 13:29 +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.

I'll fix that.

Thanks!

-- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: make app read out process num even not use SMP
  2010-09-19 13:04   ` Russell King - ARM Linux
@ 2010-09-19 16:35     ` Steven Rostedt
  2010-09-20 16:52     ` Steven Rostedt
  1 sibling, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2010-09-19 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2010-09-19 at 14:04 +0100, Russell King - ARM Linux wrote:
> 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.

Yeah, I knew there was a better way, but couldn't remember it, so I
wrote this "hack" just because it was faster than looking it up ;-)

I'll switch it over to sysconf.

Thanks again,

-- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: make app read out process num even not use SMP
  2010-09-19 13:04   ` Russell King - ARM Linux
  2010-09-19 16:35     ` Steven Rostedt
@ 2010-09-20 16:52     ` Steven Rostedt
  1 sibling, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2010-09-20 16:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2010-09-19 at 14:04 +0100, Russell King - ARM Linux wrote:

> 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.

I just pushed the update to the repo. It now uses the sysconf() feature.

I'll apply this to the stable version as well.

Thanks!

-- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-09-20 16:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-09-19 16:35     ` Steven Rostedt
2010-09-20 16:52     ` Steven Rostedt
2010-09-19 13:05   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox