public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Suzuki Poulose <suzuki@in.ibm.com>
To: Garrett Cooper <yanegomi@gmail.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: Tue, 01 Jun 2010 21:10:40 +0530	[thread overview]
Message-ID: <4C0529F8.8060906@in.ibm.com> (raw)
In-Reply-To: <4BE285FF.9030104@in.ibm.com>

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

On വ്യാഴം 06 മെയ് 2010 02:33 വൈകു, Suzuki Poulose wrote:
> On വ്യാഴം 06 മെയ് 2010 01:25 വൈകു, Garrett Cooper wrote:
>> On May 6, 2010, at 12:04 AM, Suzuki Poulose wrote:
>>
>>> <fix-timer-tests-bad-header.diff>
>>
>> Maybe a better solution would be to NULL terminate the array (well, or
>> do similar)? Using two units of measurement just seems like it'd
>> complicate how things are being performed...
>
> Used MAX_CLOCKS to mark the end of clock list array. Patch attached.

Just realized that, I sent the very old patch not the updated one. Here 
is the updated one:


>
>
> Thanks
>
> Suzuki
>> Thanks,
>> -Garrett
>


[-- Attachment #2: fix-timer-tests-bad-header.diff --]
[-- Type: text/plain, Size: 1851 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. MAX_CLOCKS marsk the end of the clock sources in the 
array.

Signed-off-by: 	Suzuki K P <suzuki@in.ibm.com>
Cc:		Garrett Cooper <yanegomi@gmail.com>

Index: ltp/testcases/kernel/timers/include/common_timers.h
===================================================================
--- ltp.orig/testcases/kernel/timers/include/common_timers.h	2010-06-01 15:28:04.000000000 +0000
+++ ltp/testcases/kernel/timers/include/common_timers.h	2010-06-01 15:34:33.000000000 +0000
@@ -28,14 +28,18 @@
 #ifndef CLOCK_MONOTONIC_RAW
 #define CLOCK_MONOTONIC_RAW 4
 #endif
+
+/* MAX_CLOCKS is the maximum number of clock sources supported by kernel */
+#define MAX_CLOCKS 16
+
 clock_t clock_list[] = {
 	CLOCK_REALTIME,
 	CLOCK_MONOTONIC,
 	CLOCK_PROCESS_CPUTIME_ID,
 	CLOCK_THREAD_CPUTIME_ID,
 	CLOCK_MONOTONIC_RAW,
+	MAX_CLOCKS
 };
-#define MAX_CLOCKS (sizeof(clock_list) / sizeof(*clock_list))
 
 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-06-01 15:28:04.000000000 +0000
+++ ltp/testcases/kernel/timers/timer_create/timer_create02.c	2010-06-01 15:34:56.000000000 +0000
@@ -113,7 +113,7 @@
 
 			setup_test(i);
 
-			for (j = 0; j < MAX_CLOCKS; ++j) {
+			for (j = 0; clock_list[j] != MAX_CLOCKS; ++j) {
 
 				if (strstr(get_clock_str(clock_list[j]),
 						"CPUTIME_ID")) {

[-- Attachment #3: Type: text/plain, Size: 80 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

  parent reply	other threads:[~2010-06-01 15:40 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   ` [LTP] [08/12 FAILURE] LTPE " Suzuki Poulose
2010-05-06  7:55     ` 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 [this message]
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=4C0529F8.8060906@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=yanegomi@gmail.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