ARM: make app read out process num even not use SMP
PATCH 1/1 ARM: make app read out process num even not use SMP
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.
--- arch/arm/kernel/setup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/kernel/setup.c +1 -0
@@ -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 );
Signature · 1 line
1.7.0.4
PATCH 1/1 ARM: make app read out process num even not use SMP
Hello.
Quoted 6 lines · Lei Wen
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<[email protected]>Signed-off-by Lei Wen<[email protected]>
One signoff is enough. :-)
WBR, Sergei
PATCH 1/1 ARM: make app read out process num even not use SMP
In reply to Lei WenQuoted 1 line · Lei Wen
Some app like trace-cmd need to know the process number, but not
That'll be "processor number".
Quoted 2 lines
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.
PATCH 1/1 ARM: make app read out process num even not use SMP
Quoted 5 lines · Russell King - ARM Linux
Quoted 1 line · Lei Wen
Some app like trace-cmd need to know the process number, but not
That'll be "processor number".
Quoted 8 lines
Quoted 2 lines
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.
PATCH 1/1 ARM: make app read out process num even not use SMP
Quoted 15 lines · Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux
Quoted 1 line · Lei Wen
Some app like trace-cmd need to know the process number, but not
That'll be "processor number".
Quoted 8 lines
Quoted 2 lines
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.
Quoted 8 lines
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/cpuinfoas noted in the glibc source code.There's a better way. sysconf with
_SC_NPROCESSORS_CONFfor the number of configured processors, or_SC_NPROCESSORS_ONLNfor 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
PATCH 1/1 ARM: make app read out process num even not use SMP
In reply to Russell King - ARM LinuxQuoted 4 lines · Russell King - ARM Linux
There's a better way. sysconf with
_SC_NPROCESSORS_CONFfor the number of configured processors, or_SC_NPROCESSORS_ONLNfor 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
PATCH 1/1 ARM: make app read out process num even not use SMP
In reply to Russell King - ARM LinuxQuoted 5 lines · Russell King - ARM Linux
Quoted 1 line · Lei Wen
Some app like trace-cmd need to know the process number, but not
That'll be "processor number".
Quoted 8 lines
Quoted 2 lines
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