Patch getcpu01 testcase
RFC 1/1 Patch getcpu01 testcase
Hi,
The getcpu01 always exits with a non-zero exit code (indicating a Failure as per UNIX semantics) on non-NUMA machines.
This is due to the following code :
tst_resm(TWARN,
"/sys not mounted or not a numa system. Assuming one
node: %s",
strerror(errno));
Being a non-NUMA machine is not a failure, but an info. So it should not cause the test to have a non zero exit status.
I have attached a patch which could do the same and provide a more friendly o/p.
Please apply.
Thanks
Suzuki
testcases/kernel/syscalls/getcpu/getcpu01.c +6 -2
@@ -47,6 +47,8 @@* HISTORY * 06/2008 written by Sharyathi Nagesh <[email protected]> * +* 05/2009 Suzuki K P <[email protected]> +* Friendly messages for non-NUMA machines. * RESTRICTIONS * none */
@@ -234,8 +236,10 @@ directory_parent =opendir ("/sys/devices/system/node" );if (!directory_parent) { -tst_resm (TWARN , -"/sys not mounted or not a numa system. Assuming one node: %s" , +tst_resm (TINFO , +"/sys not mounted or not a numa system. Assuming one node" ); +tst_resm (TINFO , +"Reason /sys/devices/system/node :%s" ,strerror (errno));return 0 ;//By Default assume it to belong to node Zero }else {
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 11 lines · Suzuki Poulose
Hi,
The getcpu01 always exits with a non-zero exit code (indicating a Failure as per UNIX semantics) on non-NUMA machines.
This is due to the following code :
tst_resm(TWARN,
"/sys not mounted or not a numa system. Assuming
one
node: %s",
Quoted 6 lines
strerror(errno));Being a non-NUMA machine is not a failure, but an info. So it should not
cause the test to have a non zero exit status.
Correct,
Quoted 43 lines
I have attached a patch which could do the same and provide a more friendly o/p.
Please apply.
Thanks
Suzukiplain text
document
attachment
(fix-warning-getcpu01.diff)Index:
ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c
===================================================================
---ltp-20081031.orig/testcases/kernel/syscalls/getcpu/getcpu01.c2008-10-23 02:23:19.000000000 -0500
+++ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c2009-05-28
11:52:54.000000000 -0500testcases/kernel/syscalls/getcpu/getcpu01.c +2
-0@@ -47,6 +47,8 @@* HISTORY * 06/2008 written by Sharyathi Nagesh <[email protected]> * +* 05/2009 Suzuki K P <[email protected]> +* Friendly messages for non-NUMA machines. * RESTRICTIONS * none */
testcases/kernel/syscalls/getcpu/getcpu01.c line 243
Quoted 10 lines
testcases/kernel/syscalls/getcpu/getcpu01.c +3
-2@@ -234,8 +236,10 @@ directory_parent =opendir ("/sys/devices/system/node" );if (!directory_parent) { - tst_resm(TWARN, - "/sys not mounted or not a numa system. Assuming one node: %s", +tst_resm (TINFO , + "/sys not mounted or not a numa system. Assuming one node"); + tst_resm(TINFO,
Use TCONF instead of TINFO. That reflects that some system configuration was missing, and, it will not return error value at all.
Regards--
Subrata
Quoted 6 lines
testcases/kernel/syscalls/getcpu/getcpu01.c +1
-0+"Reason /sys/devices/system/node :%s" , strerror(errno));return 0; //By Default assume it to belong to
node Zero} else {
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Subrata,
Good ! Then thats more suitable here :)
Refreshed the patch with TCONF and a better error message.
Thanks
Suzuki
Quoted 73 lines · Subrata Modak
Quoted 6 lines · Suzuki Poulose
Hi,
The getcpu01 always exits with a non-zero exit code (indicating a Failure as per UNIX semantics) on non-NUMA machines.
This is due to the following code :
Quoted 8 lines
tst_resm(TWARN,
"/sys not mounted or not a numa system. Assuming
one node: %s",strerror(errno));Being a non-NUMA machine is not a failure, but an info. So it should not cause the test to have a non zero exit status.
Correct,
Quoted 41 lines
I have attached a patch which could do the same and provide a more friendly o/p.
Please apply.
Thanks
Suzukiplain text
document
attachment
(fix-warning-getcpu01.diff)Index:
ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c
===================================================================
---ltp-20081031.orig/testcases/kernel/syscalls/getcpu/getcpu01.c2008-10-23 02:23:19.000000000 -0500
+++ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c2009-05-28
11:52:54.000000000 -0500(quoted diff) +2
-0@@ -47,6 +47,8 @@ * HISTORY * 06/2008 written by Sharyathi Nagesh <[email protected]> * + * 05/2009 Suzuki K P <[email protected]> + * Friendly messages for non-NUMA machines. * RESTRICTIONS * none */Review line 243
Quoted 10 lines
(quoted diff) +3
-2@@ -234,8 +236,10 @@ directory_parent = opendir("/sys/devices/system/node"); if (!directory_parent) { - tst_resm(TWARN, - "/sys not mounted or not a numa system. Assuming one node: %s", + tst_resm(TINFO, + "/sys not mounted or not a numa system. Assuming one node"); + tst_resm(TINFO,Use TCONF instead of TINFO. That reflects that some system configuration was missing, and, it will not return error value at all.
Quoted 10 lines
Regards--
SubrataQuoted 6 lines
(quoted diff) +1
-0+ "Reason /sys/devices/system/node :%s", strerror(errno));return 0; //By Default assume it to belong to
node Zero} else {
testcases/kernel/syscalls/getcpu/getcpu01.c +7 -2
@@ -47,6 +47,9 @@* HISTORY * 06/2008 written by Sharyathi Nagesh <[email protected]> * +* 05/2009 Suzuki K P <[email protected]> +* Use TCONF instead of TWARN for non-NUMA machines +* * RESTRICTIONS * none */
@@ -234,8 +237,10 @@ directory_parent =opendir ("/sys/devices/system/node" );if (!directory_parent) { -tst_resm (TWARN , -"/sys not mounted or not a numa system. Assuming one node: %s" , +tst_resm (TCONF , +"/sys not mounted or not a numa system. Assuming one node" ); +tst_resm (TCONF , +"Error opening: /sys/devices/system/node :%s" ,strerror (errno));return 0 ;//By Default assume it to belong to node Zero }else {
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 5 lines · Suzuki Poulose
Subrata,
Good ! Then thats more suitable here :)
Refreshed the patch with TCONF and a better error message.
Thanks.
Regards--
Subrata
Quoted 111 lines
Thanks
Suzuki
Quoted 77 lines · Subrata Modak
Quoted 11 lines · Suzuki Poulose
Hi,
The getcpu01 always exits with a non-zero exit code (indicating a Failure as per UNIX semantics) on non-NUMA machines.
This is due to the following code :
tst_resm(TWARN,
"/sys not mounted or not a numa system. Assuming
one
node: %s",Quoted 6 lines
strerror(errno));Being a non-NUMA machine is not a failure, but an info. So it should not
cause the test to have a non zero exit status.Correct,
Quoted 42 lines
I have attached a patch which could do the same and provide a more friendly o/p.
Please apply.
Thanks
Suzukiplain text
document
attachment
(fix-warning-getcpu01.diff)Index:
ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c
===================================================================
---ltp-20081031.orig/testcases/kernel/syscalls/getcpu/getcpu01.c2008-10-23 02:23:19.000000000 -0500
+++ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c2009-05-28
11:52:54.000000000 -0500testcases/kernel/syscalls/getcpu/getcpu01.c +2
-0@@ -47,6 +47,8 @@* HISTORY * 06/2008 written by Sharyathi Nagesh <[email protected]> * +* 05/2009 Suzuki K P <[email protected]> +* Friendly messages for non-NUMA machines. * RESTRICTIONS * none */ testcases/kernel/syscalls/getcpu/getcpu01.c line 243
Quoted 10 lines
testcases/kernel/syscalls/getcpu/getcpu01.c +3
-2@@ -234,8 +236,10 @@ directory_parent =opendir ("/sys/devices/system/node" );if (!directory_parent) { - tst_resm(TWARN, - "/sys not mounted or not a numa system. Assuming one node: %s", +tst_resm (TINFO , + "/sys not mounted or not a numa system. Assuming one node"); + tst_resm(TINFO,Use TCONF instead of TINFO. That reflects that some system configuration was missing, and, it will not return error value at all.
Quoted 10 lines
Regards--
SubrataQuoted 6 lines
(quoted diff) +1
-0+ "Reason /sys/devices/system/node :%s", strerror(errno));return 0; //By Default assume it to belong to
node Zero} else {plain text document attachment (fix-warning-getcpu01.diff)
Index:ltp-20081031/testcases/kernel/syscalls/getcpu/getcpu01.c
===================================================================testcases/kernel/syscalls/getcpu/getcpu01.c +3
-0@@ -47,6 +47,9 @@* HISTORY * 06/2008 written by Sharyathi Nagesh <[email protected]> * +* 05/2009 Suzuki K P <[email protected]> +* Use TCONF instead of TWARN for non-NUMA machines +* * RESTRICTIONS * none */ @@ -234,8 +237,10 @@ directory_parent =opendir ("/sys/devices/system/node" );
testcases/kernel/syscalls/getcpu/getcpu01.c line 246
Quoted 10 lines
testcases/kernel/syscalls/getcpu/getcpu01.c +4
-2if (!directory_parent) { -tst_resm (TWARN , -"/sys not mounted or not a numa system. Assuming one node: %s" , +tst_resm (TCONF , +"/sys not mounted or not a numa system. Assuming one node" ); +tst_resm (TCONF , +"Error opening: /sys/devices/system/node :%s" ,strerror (errno));return 0 ;//By Default assume it to belong to node Zero }else {
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list