History log of /external/ltp/testcases/kernel/timers/include/common_timers.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4e94765d753c0ea91b4745ffac30df427a4d9202 27-May-2010 Subrata Modak <subratamodak@subratamodak.linux.ibm.com> Timer related syscalls for LTP test: Signed-off-by: Suzuki K P <suzuki@in.ibm.com>,
Fix timer_t argument for timer related direct syscalls. The tests timer_getoverrun and timer_gettime should be moved to testcases/kernel/timers directory. If that is done, then we could use the definition in the common_timers.h, like the other tests.
/* Description */
There is a mismatch in the "timer_t" type defined by the Linux kernel and the GNU Libc.
Linux kernel defines it as an int for all architectures.
include/linux/types.h :
typedef __kernel_timer_t timer_t;
arch/powerpc/include/asm/posix_types.h :
typedef int __kernel_timer_t;
Now, the glibc provides a wrapper to the timer related system calls. While providing the wrapper, Glibc stores some internal data associated with the timer. So it defines the "timer_t" as a pointer (void*) as below:
/usr/include/time.h :
/* Timer ID returned by `timer_create'. */
typedef __timer_t timer_t;
in /usr/include/bits/types.h :
/* Timer ID returned by `timer_create'. */
__STD_TYPE __TIMER_T_TYPE __timer_t;
in /usr/include/bits/typesizes.h
So that leads to the definiton of timer_t as void* by glibc. And this cannot be changed. But the glibc uses the "proper" typed argument for the syscalls it issues by defining a kernel_timer_t. On 32bit machines the difference is not noticed, since both the timer_t in userspace and the kernel space are of the same size. But on 64bit machines this is different. Userspace has a width of 64bit and the kernel has 32bit width. Now, when we pass the pointer to timer_t to the kernel, things get complicated and on Big endian machines, ppc64, s390x, this leads to a problem. As the value kept is not available when we try to dereference it as a 32bit and this leads to undesired results.
/external/ltp/testcases/kernel/timers/include/common_timers.h
c98956ba8f40b4c9004ff5767db2b2d87ab46e41 07-May-2010 Subrata Modak <subratamodak@subratamodak.linux.ibm.com> The MAX_CLOCKS supported by the kernel is 16. But the kernel may not have all the clock sources defined in the range 0-15. Hence, to test whether kernel returns error for an INVALID clock source id, we should use the upper limit MAX_CLOCKS (16 at the moment). But to verify the the defined clocks work fine, we should loop through the "list" of clock sources defined for sure. MAX_CLOCKS marsk the end of the clock sources in the array.
Signed-off-by: Suzuki K P <suzuki@in.ibm.com>,
Acked-by: Garrett Cooper <yanegomi@gmail.com>,
/external/ltp/testcases/kernel/timers/include/common_timers.h
a15d642cf6dd9667aa45b02f445a9f93781c9a6a 25-Feb-2010 Garrett Cooper <yanegomi@gmail.com> Add fud for CLOCK_MONOTONIC_RAW, even though (FWIW) it doesn't work on
my system, which is bizarre, but I'm spying a delightful inconsistency
with this constant in the glibc headers and how the value is exported.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/testcases/kernel/timers/include/common_timers.h
917b2f96e8effe6c97f23b78f23e84588d9ec9a4 25-Feb-2010 Garrett Cooper <yanegomi@gmail.com> Include definitions for CLOCK_MONOTONIC_COARSE and CLOCK_REALTIME_COARSE
-- new functionality is 2.6.33, as per this commit:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=da15cfdae03351c689736f8d142618592e3cebc3

as reported by Shi Weihua <shiwh@cn.fujitsu.com>.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/testcases/kernel/timers/include/common_timers.h
1a7f54261e0ab0d8318f1833987f1a7178b546e6 06-Dec-2009 yaberauneya <yaberauneya> Wholesale testcase cleanup.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/testcases/kernel/timers/include/common_timers.h
0bd2fa8a5fb48d24e3ff5ba193ad1b1aa033a26e 26-May-2009 subrata_modak <subrata_modak> In reference to the issue with timer_create04 and clock_gettime03 for the kernel version 2.6.29 which was reported in the link: http://www.nabble.com/timer_create-p22376043.html, PFA the patch for fixing the issue. Detail on the issue: A new clockid 'CLOCK_MONOTONIC_RAW' was added since the kernel 2.6.28 (http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.28). This addition caused the above testcases to fail. Now, 5 clock ID's are resent in kernel ver 2.6.28 and later. Signed-off-by: Rohit Verma <rohit.170309@gmail.com>.
/external/ltp/testcases/kernel/timers/include/common_timers.h
e8af978e6bdaffb4c28ea9245254444d3d66be82 26-Feb-2008 subrata_modak <subrata_modak> CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID are also supported besides CLOCK_REALTIME and CLOCK_MONOTONIC. That's the cause of the failure of clock_gettime03, timer_create02 and timer_create04. Another cause is that struct sigevent evp is assigned with invalid values when option is 1. That's the cause of the failure of timer_create02 and timer_create03. CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR have been removed in the later kernel versions, hence the failures in the test. I am still trying to find out if any kernel versions used to support these. CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID are supported from 2.6.12 kernel version onwards and the test case needs to be modified for this change. Also in timer_create02.c, setup_test() case1 needs to be modified so as to make evp NULL instead of its members. Since the testcase behaves differently for different kernel versions, a version check needs to be added for making it pass across versions. I'm removing the HR clocks from the tests along with other changes, by, Anoop V. Chakkalakkal <anoop.vijayan@in.ibm.com>
/external/ltp/testcases/kernel/timers/include/common_timers.h
9cf96d8e254943cb453ab32738f250e459a2af5a 10-Sep-2006 vapier <vapier> use common header for __NR defines
/external/ltp/testcases/kernel/timers/include/common_timers.h
a9a184704f6a670793719fb0db425a8ccb5e5a6f 22-Aug-2006 vapier <vapier> take some fixes from Yi CDL Yang and create a CLOCK list for people to use as well as a func to turn a clock value into a string
/external/ltp/testcases/kernel/timers/include/common_timers.h
bc8a4616c83630c69ec3ca2bd6e4eb7acc456eee 22-Aug-2006 vapier <vapier> move common defines/functions/etc... to one header file so we have to get it right just once
/external/ltp/testcases/kernel/timers/include/common_timers.h