Hi,
The following patch Integrates the remaining MTEST06 into runltp.
Signed-Off-By: Subrata Modak <[EMAIL PROTECTED]>
--
diff -uprN ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap2.c
ltp-full-20081023/testcases/kernel/mem/mtest06/mmap2.c
--- ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap2.c
2008-10-29 19:06:10.000000000 +0530
+++ ltp-full-20081023/testcases/kernel/mem/mtest06/mmap2.c 2008-10-29
18:53:07.000000000 +0530
@@ -185,7 +185,7 @@ sig_handler(int signal) /* signa
/*
*/
/******************************************************************************/
static void
-set_timer(int run_time) /* period for which test is intended to
run */{
+set_timer(float run_time) /* period for which test is intended
to run */{
struct itimerval timer; /* timer structure, tv_sec is set to
run_time */
memset(&timer, 0, sizeof(struct itimerval));
timer.it_interval.tv_usec = 0;
@@ -240,16 +240,16 @@ usage(char *progname) /* name
int main(int argc, /* number of input parameters. */
char **argv) /* pointer to the command line arguments.
*/
{
- int fd; /* descriptor of temp file. */
- int fsize = 1; /* size of the temp file created. default 1GB
*/
- int exec_time = 24; /* period of execution, default 24 hours.
*/
- int c; /* command line options */
- int sig_ndx; /* index into signal handler structure. */
- int map_flags = /* type of mapping, defaut is MAP_SHARED .
*/
+ int fd; /* descriptor of temp file. */
+ int fsize = 1; /* size of the temp file created. default 1GB
*/
+ float exec_time = 24; /* period of execution, default 24 hours.
*/
+ int c; /* command line options */
+ int sig_ndx; /* index into signal handler structure. */
+ int map_flags = /* type of mapping, defaut is MAP_SHARED .
*/
MAP_SHARED;
- int map_anon = FALSE; /* do not map anonymous memory,map file by
default*/
- int run_once = TRUE; /* run the test once. (dont repeat)
*/
- char *memptr; /* address of the mapped file. */
+ int map_anon = FALSE; /* do not map anonymous memory,map file by
default*/
+ int run_once = TRUE; /* run the test once. (dont repeat)
*/
+ char *memptr; /* address of the mapped file. */
extern char *optarg; /* arguments passed to each option
*/
struct sigaction sigptr;/* set up signal, for interval timer
*/
@@ -287,12 +287,12 @@ int main(int argc, /* number of inpu
break;
case 's':
if ((fsize = atoi(optarg)) == 0)
- fprintf(stderr, "Using default fsize %dGB\n", fsize = 1);
+ fprintf(stderr, "Using default fsize %d GB\n", fsize = 1);
break;
case 'x':
- if ((exec_time = atoi(optarg)) == 0)
- fprintf(stderr, "Using default exec time %d hrs",
- exec_time = 24);
+ if ((exec_time = atof(optarg)) == 0)
+ fprintf(stderr, "Using default exec time %f hrs",
+ exec_time = (float)24);
run_once = FALSE;
break;
default :
@@ -302,7 +302,7 @@ int main(int argc, /* number of inpu
}
fprintf(stdout, "MM Stress test, map/write/unmap large file\n"
- "\tTest scheduled to run for: %d\n"
+ "\tTest scheduled to run for: %f\n"
"\tSize of temp file in GB: %d\n",
exec_time, fsize);
diff -uprN ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap3.c
ltp-full-20081023/testcases/kernel/mem/mtest06/mmap3.c
--- ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap3.c
2008-10-29 19:06:10.000000000 +0530
+++ ltp-full-20081023/testcases/kernel/mem/mtest06/mmap3.c 2008-10-29
18:57:29.000000000 +0530
@@ -183,7 +183,7 @@ sig_handler(int signal) /* signa
/*
*/
/******************************************************************************/
static void
-set_timer(int run_time) /* period for which test is intended to
run */{
+set_timer(float run_time) /* period for which test is intended
to run */{
struct itimerval timer; /* timer structure, tv_sec is set to
run_time */
memset(&timer, 0, sizeof(struct itimerval));
timer.it_interval.tv_usec = 0;
@@ -308,7 +308,7 @@ main(int argc, /* number of input para
int num_iter; /* number of iteration to perform
*/
int num_thrd; /* number of threads to create
*/
int thrd_ndx; /* index into the array of threads.
*/
- int exec_time; /* period for which the test is
executed */
+ float exec_time; /* period for which the test is executed */
int status; /* exit status for light weight process
*/
int sig_ndx; /* index into signal handler structure.
*/
pthread_t thid[1000]; /* pids of process that will
map/write/unmap */
@@ -358,7 +358,7 @@ main(int argc, /* number of input para
map_private = TRUE;
break;
case 'x':
- if ((exec_time = atoi(optarg)) == 0)
+ if ((exec_time = atof(optarg)) == 0)
exec_time = 24;
break;
default :
@@ -388,7 +388,7 @@ main(int argc, /* number of input para
set_timer(exec_time);
fprintf(stdout, "\n\n\nTest is set to run with the following
parameters:\n"
- "\tDuration of test: [%d]hrs\n"
+ "\tDuration of test: [%f]hrs\n"
"\tNumber of threads created: [%d]\n"
"\tnumber of map-write-unmaps: [%d]\n"
"\tmap_private?(T=1 F=0): [%d]\n\n\n\n", exec_time,
--- ltp-full-20081023/runtest/mm.orig 2008-10-29 19:03:05.000000000
+0530
+++ ltp-full-20081023/runtest/mm 2008-10-29 19:05:05.000000000 +0530
@@ -13,8 +13,11 @@ mtest01 mtest01 -p80
mtest01w mtest01 -p80 -w
#test for race conditions
-mtest05 mmstress
-mtest06 mmap1 -x 0.05
+mtest05 mmstress
+mtest06 mmap1 -x 0.05
+mtest06_2 mmap2 -x 0.002 -a -p
+mtest06_3 mmap3 -x 0.002 -p
+mtest-6_4 shmat1 -x 0.00005
mem01 mem01
mem02 mem02
Regards--
Subrata
diff -uprN ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap2.c ltp-full-20081023/testcases/kernel/mem/mtest06/mmap2.c
--- ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap2.c 2008-10-29 19:06:10.000000000 +0530
+++ ltp-full-20081023/testcases/kernel/mem/mtest06/mmap2.c 2008-10-29 18:53:07.000000000 +0530
@@ -185,7 +185,7 @@ sig_handler(int signal) /* signa
/* */
/******************************************************************************/
static void
-set_timer(int run_time) /* period for which test is intended to run */{
+set_timer(float run_time) /* period for which test is intended to run */{
struct itimerval timer; /* timer structure, tv_sec is set to run_time */
memset(&timer, 0, sizeof(struct itimerval));
timer.it_interval.tv_usec = 0;
@@ -240,16 +240,16 @@ usage(char *progname) /* name
int main(int argc, /* number of input parameters. */
char **argv) /* pointer to the command line arguments. */
{
- int fd; /* descriptor of temp file. */
- int fsize = 1; /* size of the temp file created. default 1GB */
- int exec_time = 24; /* period of execution, default 24 hours. */
- int c; /* command line options */
- int sig_ndx; /* index into signal handler structure. */
- int map_flags = /* type of mapping, defaut is MAP_SHARED . */
+ int fd; /* descriptor of temp file. */
+ int fsize = 1; /* size of the temp file created. default 1GB */
+ float exec_time = 24; /* period of execution, default 24 hours. */
+ int c; /* command line options */
+ int sig_ndx; /* index into signal handler structure. */
+ int map_flags = /* type of mapping, defaut is MAP_SHARED . */
MAP_SHARED;
- int map_anon = FALSE; /* do not map anonymous memory,map file by default*/
- int run_once = TRUE; /* run the test once. (dont repeat) */
- char *memptr; /* address of the mapped file. */
+ int map_anon = FALSE; /* do not map anonymous memory,map file by default*/
+ int run_once = TRUE; /* run the test once. (dont repeat) */
+ char *memptr; /* address of the mapped file. */
extern char *optarg; /* arguments passed to each option */
struct sigaction sigptr;/* set up signal, for interval timer */
@@ -287,12 +287,12 @@ int main(int argc, /* number of inpu
break;
case 's':
if ((fsize = atoi(optarg)) == 0)
- fprintf(stderr, "Using default fsize %dGB\n", fsize = 1);
+ fprintf(stderr, "Using default fsize %d GB\n", fsize = 1);
break;
case 'x':
- if ((exec_time = atoi(optarg)) == 0)
- fprintf(stderr, "Using default exec time %d hrs",
- exec_time = 24);
+ if ((exec_time = atof(optarg)) == 0)
+ fprintf(stderr, "Using default exec time %f hrs",
+ exec_time = (float)24);
run_once = FALSE;
break;
default :
@@ -302,7 +302,7 @@ int main(int argc, /* number of inpu
}
fprintf(stdout, "MM Stress test, map/write/unmap large file\n"
- "\tTest scheduled to run for: %d\n"
+ "\tTest scheduled to run for: %f\n"
"\tSize of temp file in GB: %d\n",
exec_time, fsize);
diff -uprN ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap3.c ltp-full-20081023/testcases/kernel/mem/mtest06/mmap3.c
--- ltp-full-20081023/testcases/kernel/mem/mtest06.orig/mmap3.c 2008-10-29 19:06:10.000000000 +0530
+++ ltp-full-20081023/testcases/kernel/mem/mtest06/mmap3.c 2008-10-29 18:57:29.000000000 +0530
@@ -183,7 +183,7 @@ sig_handler(int signal) /* signa
/* */
/******************************************************************************/
static void
-set_timer(int run_time) /* period for which test is intended to run */{
+set_timer(float run_time) /* period for which test is intended to run */{
struct itimerval timer; /* timer structure, tv_sec is set to run_time */
memset(&timer, 0, sizeof(struct itimerval));
timer.it_interval.tv_usec = 0;
@@ -308,7 +308,7 @@ main(int argc, /* number of input para
int num_iter; /* number of iteration to perform */
int num_thrd; /* number of threads to create */
int thrd_ndx; /* index into the array of threads. */
- int exec_time; /* period for which the test is executed */
+ float exec_time; /* period for which the test is executed */
int status; /* exit status for light weight process */
int sig_ndx; /* index into signal handler structure. */
pthread_t thid[1000]; /* pids of process that will map/write/unmap */
@@ -358,7 +358,7 @@ main(int argc, /* number of input para
map_private = TRUE;
break;
case 'x':
- if ((exec_time = atoi(optarg)) == 0)
+ if ((exec_time = atof(optarg)) == 0)
exec_time = 24;
break;
default :
@@ -388,7 +388,7 @@ main(int argc, /* number of input para
set_timer(exec_time);
fprintf(stdout, "\n\n\nTest is set to run with the following parameters:\n"
- "\tDuration of test: [%d]hrs\n"
+ "\tDuration of test: [%f]hrs\n"
"\tNumber of threads created: [%d]\n"
"\tnumber of map-write-unmaps: [%d]\n"
"\tmap_private?(T=1 F=0): [%d]\n\n\n\n", exec_time,
--- ltp-full-20081023/runtest/mm.orig 2008-10-29 19:03:05.000000000 +0530
+++ ltp-full-20081023/runtest/mm 2008-10-29 19:05:05.000000000 +0530
@@ -13,8 +13,11 @@ mtest01 mtest01 -p80
mtest01w mtest01 -p80 -w
#test for race conditions
-mtest05 mmstress
-mtest06 mmap1 -x 0.05
+mtest05 mmstress
+mtest06 mmap1 -x 0.05
+mtest06_2 mmap2 -x 0.002 -a -p
+mtest06_3 mmap3 -x 0.002 -p
+mtest-6_4 shmat1 -x 0.00005
mem01 mem01
mem02 mem02
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list