[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    Re: [LTP] [PATCH] fix wrong return value of inlined
From:       Subrata Modak <subrata () linux ! vnet ! ibm ! com>
Date:       2008-10-23 7:32:49
Message-ID: 1224746449.4943.7.camel () subratamodak ! linux ! ibm ! com
[Download RAW message or body]

Hi Daniel/Sharyathi,

On Mon, 2008-10-20 at 16:04 +0200, Daniel Gollub wrote:
> Hi,
> 
> the getcpu() test-function returns the current scheduled CPU id of the
> test-process for archiectures expect i386, which is not the intended return
> value of a syscall test.
> 
> Attachted patch returns instead 0, for non-i386 ARCH and __GLIBC_PREREQ(2,6).
> 
> Tested on x86_64.
> 
> Signed-off-by: Daniel Gollub <dgollub@suse.de>
> 

I have some observations regarding the getcpu01 test before and after
this patch on both x86_64 and i386 machines:

1) uname -a
Linux 2.6.27-gcov-autokern1 #1 SMP PREEMPT Thu Oct 23 02:09:37 UTC 2008
x86_64 GNU/Linux

Before Patching:
# ./testcases/kernel/syscalls/getcpu/getcpu01   
getcpu01    1  FAIL  :  getcpu() Failed, errno=0:Success


........ The last word <:Success> is quite misleading. Would you look
into that ?

Post Patching:
# ./testcases/kernel/syscalls/getcpu/getcpu01
getcpu01    1  PASS  :  getcpu() returned proper cpuid:7, node id:0
# echo $?
0

The Patch i think takes care of this.


2) uname -a
Linux 2.6.27-gcov-autokern1 #1 SMP Wed Oct 22 19:26:13 PDT 2008 i686
GNU/Linux

Both Pre & Post Patching Same result:
getcpu01    0  WARN  :  /sys not mounted or not a numa system. Assuming
one node: No such file or directory
getcpu01    1  PASS  :  getcpu() returned proper cpuid:7, node id:0

Regards--
Subrata

> ---
>  testcases/kernel/syscalls/getcpu/getcpu01.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: ltp-full-20081017/testcases/kernel/syscalls/getcpu/getcpu01.c
> ===================================================================
> --- ltp-full-20081017.orig/testcases/kernel/syscalls/getcpu/getcpu01.c
> +++ ltp-full-20081017/testcases/kernel/syscalls/getcpu/getcpu01.c
> @@ -165,7 +165,7 @@ static inline int getcpu(unsigned *cpu_i
>  	#if defined(__i386__)
>  		return syscall(318, cpu_id,node_id,cache_struct);
>  	#elif __GLIBC_PREREQ(2,6)
> -		return *cpu_id = sched_getcpu();
> +		*cpu_id = sched_getcpu();
>  	#endif
>  	return 0;
>  }
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic