From: Subrata M. <su...@li...> - 2008-08-04 10:27:33
|
> Hi > I have developed 2 test cases for getcpu() system call, Test cases > check minimal functionality of getcpu(). These test cases have a > requirement of kernel 2.6.20 and above and glibc 2.6 and above. > Currently the system call is implemented on i386 and x86_64 > architecture, in x86_64 it is implemented as virtual system call. I felt > the best way to call these system calls is to use the interface provided > by glibc in x86_64 > Man page of getcpu() can be found here: > http://www.kernel.org/doc/man-pages/online/pages/man2/getcpu.2.html > ======================================================================== > To Do Items > o Test cases are not tested on x86_64, environment > - As I am still looking for a system that satisfies all > the conditions. > o Second test case should be run on only i386 environment > - As the interface in x86_64 is very minimal and minimal scope for > error checking > o Not tested on other architectures > - PPC, Zseries etc > > ======================================================================== > Please go through the test cases and let me know of your opinion, > accordingly I can work on these test cases. Hi Sharyathi, I have the chance to execute this on some architectures (i386, x86_64 & ppc64) and under different kernel version, with the attached Makefile. Please see the results below: 1) Linux 2.6.9-74.EL #1 Tue Jun 17 16:42:36 EDT 2008 i686 athlon i386 GNU/Linux BUILD=Success, INSTALL=Success, RUN=Success with Warning, 2) Linux 2.6.18-91.el5 #1 SMP Tue Apr 22 17:43:57 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux BUILD=Success, INSTALL=Success, RUN=Success with Warning, 3) Linux 2.6.9-22.EL #1 SMP Mon Sep 19 17:52:20 EDT 2005 ppc64 ppc64 ppc64 GNU/Linux BUILD=Success, INSTALL=Success, RUN=Success with Warning, 4) Linux 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005 i686 i686 i386 GNU/Linux BUILD=Failure, cc -Wall -I../../include -g -Wall -I../../../../include -Wall getcpu01.c -L../../../../lib -lltp -o getcpu01 getcpu01.c: In function `set_cpu_affinity': getcpu01.c:196: warning: passing arg 2 of `sched_getaffinity' makes pointer from integer without a cast getcpu01.c:196: too many arguments to function `sched_getaffinity' getcpu01.c:203: warning: passing arg 2 of `sched_setaffinity' makes pointer from integer without a cast getcpu01.c:203: too many arguments to function `sched_setaffinity' make[4]: *** [getcpu01] Error 1 5) Linux 2.6.18-91.el5 #1 SMP Tue Apr 22 17:48:59 EDT 2008 ppc64 ppc64 ppc64 GNU/Linux BUILD=Success, INSTALL=Success, RUN=Success with Warning, 6) Linux 2.6.18-91.el5PAE #1 SMP Tue Apr 22 17:58:37 EDT 2008 i686 athlon i386 GNU/Linux BUILD=Success, INSTALL=Success, RUN=Success with Warning, 7) Linux 2.6.25-gcov-nomodconfig-smp #1 SMP Thu Jun 12 06:29:27 EDT 2008 i686 i686 i386 GNU/Linux BUILD=Success, INSTALL=Success, RUN=Success, 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:0, node id:0 getcpu02 1 PASS : expected failure - errno = 14 - Bad address Some observations: 1) I think the error handling has been done pretty well for these 3 architectures across most of the kernel version, during compilation & installation. But see the error for i386 under kernel 2.4.21-37.ELsmp. There should not be any error. The Makefile should be able to handle if certain definitions/libraries are not supported. 2) The run is properly handled when it is not supported. But it should be throwing warning (WARN), instead it should say CONF. Please see pages 4 & 5 of OLS_2002 paper which describes when and how WARN, CONF, etc should be used, 3) Please see whether the result on execution on kernel above 2.6.20 on i386 is correct, 4) Also please test it once on ia64 and s390x machines under varying kernel version. Thanks for sending out the patches for the getcpu() syscall tests. Please resend it with the corresponding Makefile(s) and the error handling code as well. It would also be great if you can also post your results on various architectures and kernel versions. Regards-- Subrata > > Thanks > Yeehaw > > > > |