* [LTP] [PATCH] numa01.sh: fix error in getting number of CPUs
@ 2012-11-23 5:42 Simon Xu
2012-11-23 5:46 ` Wanlong Gao
0 siblings, 1 reply; 4+ messages in thread
From: Simon Xu @ 2012-11-23 5:42 UTC (permalink / raw)
To: ltp-list
test04 in numa01.sh is using a wrong method to get the number of CPUs.
This results in:
numactl: cpu argument 9 is out of range
awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
(No such file or directory)
/opt/ltp/testcases/bin/numa01.sh: line 475: [: =: unary operator expected
awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
(No such file or directory)
/opt/ltp/testcases/bin/numa01.sh: line 481: [: -ne: unary operator expected
/opt/ltp/testcases/bin/numa01.sh: line 488: kill: (4116) - No such process
numa04 4 TBROK : Kill on process 4116 fails
Fix it by getting number of CPUs by grepping /proc/cpuinfo.
---
testcases/kernel/numa/numa01.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/numa/numa01.sh b/testcases/kernel/numa/numa01.sh
index 3ea7950..8d0808a 100644
--- a/testcases/kernel/numa/numa01.sh
+++ b/testcases/kernel/numa/numa01.sh
@@ -466,7 +466,7 @@ test04()
run_on_cpu=0
running_on_cpu=0
- no_of_cpus=$(ls /sys/devices/system/cpu/ | wc -w)
+ no_of_cpus=$(grep "^processor" /proc/cpuinfo | wc -l)
# not sure whether cpu's can't be in odd number
run_on_cpu=$[$[$no_of_cpus+1]/2]
numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for sigint
--
1.8.0
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] numa01.sh: fix error in getting number of CPUs
2012-11-23 5:42 [LTP] [PATCH] numa01.sh: fix error in getting number of CPUs Simon Xu
@ 2012-11-23 5:46 ` Wanlong Gao
2012-11-23 5:51 ` Simon Xu
0 siblings, 1 reply; 4+ messages in thread
From: Wanlong Gao @ 2012-11-23 5:46 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
On 11/23/2012 01:42 PM, Simon Xu wrote:
> test04 in numa01.sh is using a wrong method to get the number of CPUs.
> This results in:
>
> numactl: cpu argument 9 is out of range
>
> awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
> (No such file or directory)
> /opt/ltp/testcases/bin/numa01.sh: line 475: [: =: unary operator expected
> awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
> (No such file or directory)
> /opt/ltp/testcases/bin/numa01.sh: line 481: [: -ne: unary operator expected
> /opt/ltp/testcases/bin/numa01.sh: line 488: kill: (4116) - No such process
> numa04 4 TBROK : Kill on process 4116 fails
>
> Fix it by getting number of CPUs by grepping /proc/cpuinfo.
> ---
> testcases/kernel/numa/numa01.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/numa/numa01.sh b/testcases/kernel/numa/numa01.sh
> index 3ea7950..8d0808a 100644
> --- a/testcases/kernel/numa/numa01.sh
> +++ b/testcases/kernel/numa/numa01.sh
> @@ -466,7 +466,7 @@ test04()
> run_on_cpu=0
> running_on_cpu=0
>
> - no_of_cpus=$(ls /sys/devices/system/cpu/ | wc -w)
> + no_of_cpus=$(grep "^processor" /proc/cpuinfo | wc -l)
We have commands tst_ncpus and tst_ncpus_max to get the number of cpu in the system.
Thanks,
Wanlong Gao
> # not sure whether cpu's can't be in odd number
> run_on_cpu=$[$[$no_of_cpus+1]/2]
> numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for sigint
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] numa01.sh: fix error in getting number of CPUs
2012-11-23 5:46 ` Wanlong Gao
@ 2012-11-23 5:51 ` Simon Xu
2012-11-23 7:04 ` Wanlong Gao
0 siblings, 1 reply; 4+ messages in thread
From: Simon Xu @ 2012-11-23 5:51 UTC (permalink / raw)
To: gaowanlong; +Cc: ltp-list
On 2012/11/23 13:46, Wanlong Gao wrote:
> On 11/23/2012 01:42 PM, Simon Xu wrote:
>> test04 in numa01.sh is using a wrong method to get the number of CPUs.
>> This results in:
>>
>> numactl: cpu argument 9 is out of range
>>
>> awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
>> (No such file or directory)
>> /opt/ltp/testcases/bin/numa01.sh: line 475: [: =: unary operator expected
>> awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
>> (No such file or directory)
>> /opt/ltp/testcases/bin/numa01.sh: line 481: [: -ne: unary operator expected
>> /opt/ltp/testcases/bin/numa01.sh: line 488: kill: (4116) - No such process
>> numa04 4 TBROK : Kill on process 4116 fails
>>
>> Fix it by getting number of CPUs by grepping /proc/cpuinfo.
>> ---
>> testcases/kernel/numa/numa01.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/testcases/kernel/numa/numa01.sh b/testcases/kernel/numa/numa01.sh
>> index 3ea7950..8d0808a 100644
>> --- a/testcases/kernel/numa/numa01.sh
>> +++ b/testcases/kernel/numa/numa01.sh
>> @@ -466,7 +466,7 @@ test04()
>> run_on_cpu=0
>> running_on_cpu=0
>>
>> - no_of_cpus=$(ls /sys/devices/system/cpu/ | wc -w)
>> + no_of_cpus=$(grep "^processor" /proc/cpuinfo | wc -l)
> We have commands tst_ncpus and tst_ncpus_max to get the number of cpu in the system.
That's fine. Please fix this issue the LTP way.
Thanks
Simon
>> # not sure whether cpu's can't be in odd number
>> run_on_cpu=$[$[$no_of_cpus+1]/2]
>> numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for sigint
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] numa01.sh: fix error in getting number of CPUs
2012-11-23 5:51 ` Simon Xu
@ 2012-11-23 7:04 ` Wanlong Gao
0 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2012-11-23 7:04 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
On 11/23/2012 01:51 PM, Simon Xu wrote:
> On 2012/11/23 13:46, Wanlong Gao wrote:
>> On 11/23/2012 01:42 PM, Simon Xu wrote:
>>> test04 in numa01.sh is using a wrong method to get the number of CPUs.
>>> This results in:
>>>
>>> numactl: cpu argument 9 is out of range
>>>
>>> awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
>>> (No such file or directory)
>>> /opt/ltp/testcases/bin/numa01.sh: line 475: [: =: unary operator expected
>>> awk: cmd. line:1: fatal: cannot open file `/proc/4116/stat' for reading
>>> (No such file or directory)
>>> /opt/ltp/testcases/bin/numa01.sh: line 481: [: -ne: unary operator expected
>>> /opt/ltp/testcases/bin/numa01.sh: line 488: kill: (4116) - No such process
>>> numa04 4 TBROK : Kill on process 4116 fails
>>>
>>> Fix it by getting number of CPUs by grepping /proc/cpuinfo.
>>> ---
>>> testcases/kernel/numa/numa01.sh | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/testcases/kernel/numa/numa01.sh b/testcases/kernel/numa/numa01.sh
>>> index 3ea7950..8d0808a 100644
>>> --- a/testcases/kernel/numa/numa01.sh
>>> +++ b/testcases/kernel/numa/numa01.sh
>>> @@ -466,7 +466,7 @@ test04()
>>> run_on_cpu=0
>>> running_on_cpu=0
>>> - no_of_cpus=$(ls /sys/devices/system/cpu/ | wc -w)
>>> + no_of_cpus=$(grep "^processor" /proc/cpuinfo | wc -l)
>> We have commands tst_ncpus and tst_ncpus_max to get the number of cpu in the system.
>
> That's fine. Please fix this issue the LTP way.
Thank you, I made a patch to fix this, please refer to: https://github.com/linux-test-project/ltp/commit/9b87d9c5678ad3dc2cf561774c7a1c6a16388935
Wanlong Gao
>
> Thanks
> Simon
>
>>> # not sure whether cpu's can't be in odd number
>>> run_on_cpu=$[$[$no_of_cpus+1]/2]
>>> numactl --physcpubind=$run_on_cpu support_numa $PAUSE & #just waits for sigint
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-23 7:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23 5:42 [LTP] [PATCH] numa01.sh: fix error in getting number of CPUs Simon Xu
2012-11-23 5:46 ` Wanlong Gao
2012-11-23 5:51 ` Simon Xu
2012-11-23 7:04 ` Wanlong Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox