public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Suzuki Poulose <suzuki@in.ibm.com>
To: Subrata Modak <subrata@linux.vnet.ibm.com>
Cc: Linus Test Project <ltp-list@lists.sourceforge.net>,
	B N Poornima <bnpoorni@in.ibm.com>,
	Sachin P Sant <ssant@in.ibm.com>,
	Sharyathi Nagesh <sharyath@in.ibm.com>
Subject: Re: [LTP] [08/12 FAILURE] LTPE clock gettime03 fails
Date: Thu, 06 May 2010 12:34:58 +0530	[thread overview]
Message-ID: <4BE26A1A.1000102@in.ibm.com> (raw)
In-Reply-To: <20100506065801.23879.92449.sendpatchset@subratamodak.linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]

On വ്യാഴം 06 മെയ് 2010 12:28 വൈകു, Subrata Modak wrote:
> Subject: LTPE^[ clock_gettime03 fails
>
> Issue Description below:
> =======================================
> # ./runltp -s clock_gettime03
> <<<test_output>>>
> clock_gettime03    1  TPASS  :  got expected failure: TEST_ERRNO=EFAULT(14):
> Bad address
> clock_gettime03    2  TPASS  :  got expected failure: TEST_ERRNO=EFAULT(14):
> Bad address
> clock_gettime03    3  TFAIL  :  failed to produce expected error [expected
> errno = 22 (Invalid argument), TEST_RETURN = 0]: TEST_ERRNO=???(0): Success
> clock_gettime03    4  TFAIL  :  failed to produce expected error [expected
> errno = 22 (Invalid argument), TEST_RETURN = 0]: TEST_ERRNO=???(0): Success
> clock_gettime03    5  TPASS  :  got expected failure: TEST_ERRNO=EFAULT(14):
> Bad address
> clock_gettime03    6  TPASS  :  got expected failure: TEST_ERRNO=EFAULT(14):
> Bad address
> <<<execution_status>>>
> initiation_status="ok"
> duration=0 termination_type=exited termination_id=1 corefile=no
> cutime=0 cstime=1
> <<<test_end>>>
>
> SUZUKI K. POULOSE gave the following patch already. Not sure if it is
> discussed in the mailing list:
> --- include/common_timers.h.orig        2010-04-30 12:39:08.000000000 +0000
> +++ include/common_timers.h     2010-04-30 12:39:46.000000000 +0000
> @@ -35,7 +35,8 @@ clock_t clock_list[] = {
>          CLOCK_THREAD_CPUTIME_ID,
>          CLOCK_MONOTONIC_RAW,
>   };
> -#define MAX_CLOCKS (sizeof(clock_list) / sizeof(*clock_list))
> +// #define MAX_CLOCKS (sizeof(clock_list) / sizeof(*clock_list))
> +#define MAX_CLOCKS 16
>
>   const char *get_clock_str(const int clock_id)
>   {
>
>
> The above patch fixes the problem. For more info, see linux/time.h for the
> MAX_CLOCKS value.

The above patch indeed fixes the two issues, but it causes a regression 
for timer_create02 testcase. The complete patch is attached with this.


>
> Regards--
> Subrata
>


[-- Attachment #2: fix-timer-tests-bad-header.diff --]
[-- Type: text/plain, Size: 1730 bytes --]

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. (Used as CLOCKS_DEFINED below)

Signed-off-by: Suzuki K P <suzuki@in.ibm.com>

Index: ltp/testcases/kernel/timers/include/common_timers.h
===================================================================
--- ltp.orig/testcases/kernel/timers/include/common_timers.h	2009-12-06 20:53:44.000000000 +0000
+++ ltp/testcases/kernel/timers/include/common_timers.h	2010-05-05 09:17:58.000000000 +0000
@@ -35,7 +35,10 @@
 	CLOCK_THREAD_CPUTIME_ID,
 	CLOCK_MONOTONIC_RAW,
 };
-#define MAX_CLOCKS (sizeof(clock_list) / sizeof(*clock_list))
+/* CLOCKS_DEFINED is the number of clock sources defined for sure */
+#define CLOCKS_DEFINED (sizeof(clock_list) / sizeof(*clock_list))
+/* MAX_CLOCKS is the maximum number of clock sources supported by kernel */
+#define MAX_CLOCKS 16
 
 const char *get_clock_str(const int clock_id)
 {
Index: ltp/testcases/kernel/timers/timer_create/timer_create02.c
===================================================================
--- ltp.orig/testcases/kernel/timers/timer_create/timer_create02.c	2010-05-05 09:18:21.000000000 +0000
+++ ltp/testcases/kernel/timers/timer_create/timer_create02.c	2010-05-05 09:18:38.000000000 +0000
@@ -113,7 +113,7 @@
 
 			setup_test(i);
 
-			for (j = 0; j < MAX_CLOCKS; ++j) {
+			for (j = 0; j < CLOCKS_DEFINED; ++j) {
 
 				if (strstr(get_clock_str(clock_list[j]),
 						"CPUTIME_ID")) {

[-- Attachment #3: Type: text/plain, Size: 79 bytes --]

------------------------------------------------------------------------------

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2010-05-06  7:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06  6:55 [LTP] [00/12 FAILURE] Reporting LTP run issues on Fedora 13 ppc6 Subrata Modak
2010-05-06  6:56 ` [01/12 FAILURE] LTPX Memory CGROUP test creates Call Trace and Badness at mm/oom_kill.c:393 Subrata Modak
2010-05-06  6:56 ` [02/12 FAILURE] LTPX File Capabilities tests becomes defunct and does not complete beyond 12 hours Subrata Modak
2010-05-06  6:56 ` [03/12 FAILURE] LTPX Memory Conroller test fails and hangs system for more than " Subrata Modak
2010-05-06  6:56 ` [04/12 FAILURE] LTPX sysctl03 test fails Subrata Modak
2010-05-06  8:05   ` [LTP] [04/12 FAILURE] LTP? " Garrett Cooper
2010-05-06 13:53     ` Serge E. Hallyn
2010-05-06 17:38       ` Garrett Cooper
2010-05-06 17:55         ` Serge E. Hallyn
2010-05-06 17:59           ` Garrett Cooper
2010-05-06 18:39             ` Serge E. Hallyn
2010-05-07  9:05               ` Subrata Modak
2010-05-07  9:22               ` Garrett Cooper
2010-05-06  6:57 ` [05/12 FAILURE] LTPX proc01 " Subrata Modak
2010-05-06  8:04   ` [LTP] [05/12 FAILURE] LTP? " Garrett Cooper
2010-07-27 17:37     ` Subrata Modak
2010-07-27 17:38     ` Subrata Modak
2010-05-06  6:57 ` [LTP] [06/12 FAILURE] Many CONTAINER tests of LTP fail Subrata Modak
2010-05-06 17:53   ` Garrett Cooper
2010-05-06 17:59     ` Dan Smith
2010-07-27 17:40     ` Subrata Modak
2010-05-06  6:57 ` [07/12 FAILURE] LTPX MEMORY CGROUP FUNCTION tests fails Subrata Modak
2010-07-28 17:34   ` [LTP] [07/12 FAILURE] LTPE " Subrata Modak
2010-05-06  6:58 ` [08/12 FAILURE] LTPX clock gettime03 fails Subrata Modak
2010-05-06  7:04   ` Suzuki Poulose [this message]
2010-05-06  7:55     ` [LTP] [08/12 FAILURE] LTPE " Garrett Cooper
2010-05-06  9:03       ` Suzuki Poulose
2010-05-06 17:42         ` Garrett Cooper
2010-05-07  8:53           ` Subrata Modak
2010-06-01 15:40         ` Suzuki Poulose
2010-06-02 12:57           ` Subrata Modak
2010-07-27 18:03             ` Subrata Modak
2010-05-06  6:58 ` [09/12 FAILURE] LTPX timer create04 fails Subrata Modak
2010-05-07  2:12   ` [LTP] [09/12 FAILURE] LTP " Henry xu
2010-07-28 12:46   ` [LTP] [09/12 FAILURE] LTPE " Subrata Modak
2010-05-06  6:58 ` [10/12 FAILURE] LTPX ar01 fails Subrata Modak
2010-05-06  6:58 ` [11/12 FAILURE] LTPX file test fails Subrata Modak
2010-05-06  8:01   ` [LTP] [11/12 FAILURE] LTP? " Garrett Cooper
2010-05-06  6:59 ` [12/12 FAILURE] LTPX cron tests fails Subrata Modak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BE26A1A.1000102@in.ibm.com \
    --to=suzuki@in.ibm.com \
    --cc=bnpoorni@in.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=sharyath@in.ibm.com \
    --cc=ssant@in.ibm.com \
    --cc=subrata@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox