From: Chirag J. <ch...@li...> - 2008-11-26 05:03:49
|
Hi, These patches remove the jvmsim library and references from all applications that optionally use it. Signed-Off-By: Chirag <ch...@li...> PATCH 1/2 - Remove all references of jvmsim from tests. PATCH 2/2 - Remove the libjvmsim and associated files. -- -Thanks,Chirag |
From: Chirag J. <ch...@li...> - 2008-11-26 05:09:05
|
Most of the testcases, have an option (-j) which runs the jvmsim as a background load so as to simulate the behavior of the JVM. This patch removes the references of jvmsim from all the testcases. Signed-Off-By: Chirag <ch...@li...> Acked-by: Sripathi Kodi <sri...@in...> func/async_handler/async_handler.c | 15 +-------------- func/async_handler/async_handler_jk.c | 15 +-------------- func/async_handler/async_handler_tsc.c | 16 +--------------- func/gtod_latency/gtod_infinite.c | 16 +--------------- func/gtod_latency/gtod_latency.c | 1 - func/hrtimer-prio/hrtimer-prio.c | 14 -------------- func/matrix_mult/matrix_mult.c | 16 +--------------- func/measurement/preempt_timing.c | 16 +--------------- func/periodic_cpu_load/periodic_cpu_load.c | 15 +-------------- func/periodic_cpu_load/periodic_cpu_load_single.c | 16 +--------------- func/pi-tests/sbrk_mutex.c | 16 +--------------- func/pi-tests/test-skeleton.c | 16 +--------------- func/pi-tests/testpi-0.c | 1 - func/pi-tests/testpi-1.c | 16 +--------------- func/pi-tests/testpi-2.c | 16 +--------------- func/pi-tests/testpi-4.c | 16 +--------------- func/pi-tests/testpi-5.c | 1 - func/pi-tests/testpi-6.c | 1 - func/pi-tests/testpi-7.c | 16 +--------------- func/prio-preempt/prio-preempt.c | 8 +------- func/prio-wake/prio-wake.c | 16 +--------------- func/pthread_kill_latency/pthread_kill_latency.c | 15 +-------------- func/sched_football/sched_football.c | 16 +--------------- func/sched_jitter/sched_jitter.c | 16 +--------------- func/sched_latency/sched_latency.c | 16 +--------------- func/thread_clock/tc-2.c | 16 +--------------- perf/latency/pthread_cond_latency.c | 16 +--------------- stress/pi-tests/lookup_pi_state.c | 18 +----------------- stress/pi-tests/testpi-3.c | 17 +---------------- 29 files changed, 24 insertions(+), 369 deletions(-) Index: ltp/testcases/realtime/func/async_handler/async_handler.c =================================================================== --- ltp.orig/testcases/realtime/func/async_handler/async_handler.c +++ ltp/testcases/realtime/func/async_handler/async_handler.c @@ -26,7 +26,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -40,7 +39,6 @@ #include <stdlib.h> #include <math.h> #include <librttest.h> -#include <libjvmsim.h> #include <libstats.h> #include <getopt.h> @@ -53,7 +51,6 @@ static nsec_t start; static nsec_t end; static int iterations = 0; -static int run_jvmsim = 0; #define CHILD_START 0 #define CHILD_WAIT 1 @@ -70,7 +67,6 @@ void usage(void) { rt_help(); printf("async_handler specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -iITERATIONS number of iterations to calculate the average over\n"); } @@ -79,9 +75,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -181,18 +174,12 @@ int main(int argc, char *argv[]) printf("-----------------------------------\n\n"); pass_criteria = PASS_US; - rt_init("ji:h", parse_args, argc, argv); + rt_init("i:h", parse_args, argc, argv); init_pi_mutex(&mutex); atomic_set(CHILD_START, &step); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } if (iterations == 0) iterations = DEFAULT_ITERATIONS; printf("Running %d iterations\n", iterations); Index: ltp/testcases/realtime/func/async_handler/async_handler_jk.c =================================================================== --- ltp.orig/testcases/realtime/func/async_handler/async_handler_jk.c +++ ltp/testcases/realtime/func/async_handler/async_handler_jk.c @@ -29,7 +29,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * John Kacur <jk...@ca...> @@ -43,7 +42,6 @@ #include <stdlib.h> #include <math.h> #include <librttest.h> -#include <libjvmsim.h> #include <libstats.h> // This is the normal priority for an event handler if not specified. @@ -52,7 +50,6 @@ #define PASS_US 100 long start, end; -static int run_jvmsim = 0; /* Function Prototypes */ void *async_event_server(void *arg); @@ -62,7 +59,6 @@ void usage(void) { rt_help(); printf("async_handler_jk specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -70,9 +66,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -149,13 +142,7 @@ int main(int argc, char* argv[]) setup(); pass_criteria = PASS_US; - rt_init("jh", parse_args, argc, argv); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("h", parse_args, argc, argv); aes_id = create_fifo_thread(async_event_server, (void*)0, 83); server = get_thread(aes_id); Index: ltp/testcases/realtime/func/async_handler/async_handler_tsc.c =================================================================== --- ltp.orig/testcases/realtime/func/async_handler/async_handler_tsc.c +++ ltp/testcases/realtime/func/async_handler/async_handler_tsc.c @@ -29,7 +29,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -45,7 +44,6 @@ #include <stdint.h> #include <pthread.h> #include <librttest.h> -#include <libjvmsim.h> #include <libstats.h> #define HANDLER_PRIO 98 @@ -71,13 +69,11 @@ pthread_cond_t cond = PTHREAD_COND_INITI pthread_mutex_t mutex; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("async_handler_tsc specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -85,9 +81,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -199,7 +192,7 @@ int main(int argc, char *argv[]) int signal_id, handler_id; setup(); - rt_init("jh", parse_args, argc, argv); + rt_init("h", parse_args, argc, argv); printf("-------------------------------\n"); printf("Asynchronous Event Handling Latency\n"); @@ -213,13 +206,6 @@ int main(int argc, char *argv[]) init_pi_mutex(&mutex); atomic_set(CHILD_START, &step); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - handler_id = create_fifo_thread(handler_thread, (void*)0, HANDLER_PRIO); signal_id = create_fifo_thread(signal_thread, (void*)0, SIGNAL_PRIO); Index: ltp/testcases/realtime/func/gtod_latency/gtod_infinite.c =================================================================== --- ltp.orig/testcases/realtime/func/gtod_latency/gtod_infinite.c +++ ltp/testcases/realtime/func/gtod_latency/gtod_infinite.c @@ -37,7 +37,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -52,7 +51,6 @@ #include <time.h> #include <sched.h> #include <librttest.h> -#include <libjvmsim.h> #include <sys/mman.h> /* #define CLOCK_TO_USE CLOCK_MONOTONIC */ @@ -61,14 +59,12 @@ #define START_MAX 3000 #define REPORT_MIN 1000000 -static int run_jvmsim = 0; static unsigned int max_window = 0; /* infinite, don't use a window */ void usage(void) { rt_help(); printf("gtod_infinite specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -wWINDOW iterations in max value window (default inf)\n"); } @@ -76,9 +72,6 @@ int parse_args(int c, char *v) { int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -113,14 +106,7 @@ int main(int argc, char *argv[]) exit(1); } */ - rt_init("jhw:", parse_args, argc, argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); - } else { - printf("jvmsim disabled\n"); - } + rt_init("hw:", parse_args, argc, argv); mlockall(MCL_CURRENT|MCL_FUTURE); Index: ltp/testcases/realtime/func/gtod_latency/gtod_latency.c =================================================================== --- ltp.orig/testcases/realtime/func/gtod_latency/gtod_latency.c +++ ltp/testcases/realtime/func/gtod_latency/gtod_latency.c @@ -30,7 +30,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> Index: ltp/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c =================================================================== --- ltp.orig/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c +++ ltp/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c @@ -29,7 +29,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -43,7 +42,6 @@ #include <stdlib.h> #include <math.h> #include <librttest.h> -#include <libjvmsim.h> #include <libstats.h> #define DEF_MED_PRIO 60 // (softirqd-hrtimer,98) @@ -53,7 +51,6 @@ #define DEF_SLEEP_TIME 10000 // Duration of nanosleep in nanoseconds #define DEF_CRITERIA 10 // maximum timer latency in microseconds -static int run_jvmsim = 0; static int med_prio = DEF_MED_PRIO; static int high_prio; static int busy_time = DEF_BUSY_TIME; @@ -69,7 +66,6 @@ void usage(void) { rt_help(); printf("hrtimer-prio specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -t# #:busy work time in ms, defaults to %d ms\n", DEF_BUSY_TIME); printf(" -i# #:number of iterations, defaults to %d\n", DEF_ITERATIONS); printf(" -n# #:number of busy threads, defaults to NR_CPUS*2\n"); @@ -82,9 +78,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -175,13 +168,6 @@ int main(int argc, char *argv[]) printf("Busy thread priority: %d\n", med_prio); printf("Timer thread priority: %d\n", high_prio); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - stats_container_t hist; stats_quantiles_t quantiles; if (stats_container_init(&dat, iterations)) { Index: ltp/testcases/realtime/func/matrix_mult/matrix_mult.c =================================================================== --- ltp.orig/testcases/realtime/func/matrix_mult/matrix_mult.c +++ ltp/testcases/realtime/func/matrix_mult/matrix_mult.c @@ -26,7 +26,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -41,7 +40,6 @@ #include <stdlib.h> #include <math.h> #include <librttest.h> -#include <libjvmsim.h> #include <libstats.h> #define MAX_CPUS 8192 @@ -60,7 +58,6 @@ #define THREAD_SLEEP 1 * NS_PER_US -static int run_jvmsim = 0; static int ops = DEF_OPS; static int numcpus; static float criteria; @@ -79,7 +76,6 @@ void usage(void) { rt_help(); printf("matrix_mult specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -l# #: number of multiplications per iteration (load)\n"); printf(" -i# #: number of iterations\n"); } @@ -88,9 +84,6 @@ int parse_args(int c, char *v) { int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'i': iterations = atoi(v); break; @@ -317,7 +310,7 @@ int main(int argc, char *argv[]) { setup(); pass_criteria = PASS_CRITERIA; - rt_init("jl:i:h", parse_args, argc, argv); + rt_init("l:i:h", parse_args, argc, argv); numcpus = sysconf(_SC_NPROCESSORS_ONLN); /* the minimum avg concurrent multiplier to pass */ criteria = pass_criteria * numcpus; @@ -348,13 +341,6 @@ int main(int argc, char *argv[]) printf("Calculations per iteration: %d\n", ops); printf("Number of CPUs: %u\n", numcpus); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); /* Start the JVM simulation */ - } else { - printf("jvmsim disabled\n"); - } - set_priority(PRIO); main_thread(); Index: ltp/testcases/realtime/func/measurement/preempt_timing.c =================================================================== --- ltp.orig/testcases/realtime/func/measurement/preempt_timing.c +++ ltp/testcases/realtime/func/measurement/preempt_timing.c @@ -32,7 +32,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * @@ -53,19 +52,16 @@ #include <sys/mman.h> #include <stdint.h> #include <librttest.h> -#include <libjvmsim.h> #define ITERATIONS 1000000ULL #define INTERVALS 10 -static int run_jvmsim=0; void usage(void) { rt_help(); printf("preempt_timing specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -73,9 +69,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -97,14 +90,7 @@ int main(int argc, char *argv[]) min = -1; setup(); - rt_init("jh",parse_args,argc,argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("h",parse_args,argc,argv); /* switch to SCHED_FIFO 99 */ param.sched_priority = sched_get_priority_max(SCHED_FIFO); Index: ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load.c =================================================================== --- ltp.orig/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load.c +++ ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -40,7 +39,6 @@ #include <math.h> #include <librttest.h> #include <libstats.h> -#include <libjvmsim.h> #define PRIO_A 63 #define PRIO_B 53 @@ -68,7 +66,6 @@ stats_container_t dat[THREADS_PER_GROUP stats_quantiles_t quantiles[THREADS_PER_GROUP * NUM_GROUPS]; static const char groupname[NUM_GROUPS] = "ABC"; -static int run_jvmsim = 0; static int iterations = ITERATIONS; static int ret = 0; @@ -77,15 +74,12 @@ void usage(void) rt_help(); printf("periodic_cpu_load specific options:\n"); printf(" -iITERATIONS number of iterations to calculate the average over\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) { int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; break; case 'i': iterations = atoi(v); @@ -170,7 +164,7 @@ int main(int argc, char *argv[]) int i; setup(); - rt_init("jhi:", parse_args, argc, argv); + rt_init("hi:", parse_args, argc, argv); if (iterations < 100) { fprintf(stderr, "Number of iteration cannot be less than 100.\n"); @@ -195,13 +189,6 @@ int main(int argc, char *argv[]) printf(" period: %d ms\n", PERIOD_C/NS_PER_MS); printf("\n"); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - for (i=0; i<(THREADS_PER_GROUP * NUM_GROUPS); i++) { stats_container_init(&dat[i], iterations); stats_quantiles_init(&quantiles[i], (int)log10(iterations)); Index: ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load_single.c =================================================================== --- ltp.orig/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load_single.c +++ ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load_single.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -40,7 +39,6 @@ #include <math.h> #include <librttest.h> #include <libstats.h> -#include <libjvmsim.h> #define HIST_BUCKETS 100 @@ -55,7 +53,6 @@ static int prio; static int period; static int calc_loops; -static int run_jvmsim = 0; static int ret = 0; static char *filename_prefix = DEFAULT_FILENAME_PREFIX; static int iterations = DEFAULT_ITERATIONS; @@ -67,7 +64,6 @@ void usage(void) printf(" -lCALC_LOOPS loops per iteration\n"); printf(" -fFILENAME_PREFIX filename prefix for plot output\n"); printf(" -iITERATIONS number of iterations to calculate the average over\n"); - printf(" -j enable jvmsim\n"); printf(" -r[0-99] real-time priority\n"); printf(" -tPERIOD period in ms\n"); } @@ -175,9 +171,6 @@ int parse_args(int c, char *v) case 'i': iterations = atoi(v); break; - case 'j': - run_jvmsim = 1; - break; case 'r': prio = atoi(v); break; @@ -198,7 +191,7 @@ int main(int argc, char *argv[]) calc_loops = DEFAULT_CALC_LOOPS; setup(); - rt_init("f:jhi:r:t:l:", parse_args, argc, argv); + rt_init("f:hi:r:t:l:", parse_args, argc, argv); if (iterations < 100) { printf("Number of iterations cannot be less than 100\n"); @@ -221,13 +214,6 @@ int main(int argc, char *argv[]) printf(" loops: %d\n", calc_loops); printf(" logs: %s*\n", filename_prefix); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - ret = periodic_thread(period, iterations, calc_loops); return ret; Index: ltp/testcases/realtime/func/pi-tests/testpi-0.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-0.c +++ ltp/testcases/realtime/func/pi-tests/testpi-0.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Index: ltp/testcases/realtime/func/pi-tests/testpi-1.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-1.c +++ ltp/testcases/realtime/func/pi-tests/testpi-1.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * @@ -44,16 +43,13 @@ #include <sys/syscall.h> #include <unistd.h> #include <librttest.h> -#include <libjvmsim.h> -static int run_jvmsim=0; pthread_barrier_t barrier; void usage(void) { rt_help(); printf("testpi-1 specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -61,9 +57,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -204,20 +197,13 @@ int main(int argc, char* argv[]) { CPU_SET(0, &mask); setup(); - rt_init("jh",parse_args,argc,argv); + rt_init("h",parse_args,argc,argv); if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { printf("pthread_barrier_init failed: %s\n", strerror(retc)); exit(retc); } - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - retc = sched_setaffinity(0, sizeof(mask), &mask); if (retc < 0) { printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); Index: ltp/testcases/realtime/func/pi-tests/testpi-2.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-2.c +++ ltp/testcases/realtime/func/pi-tests/testpi-2.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * @@ -44,16 +43,13 @@ #include <sys/syscall.h> #include <unistd.h> #include <librttest.h> -#include <libjvmsim.h> -static int run_jvmsim=0; pthread_barrier_t barrier; void usage(void) { rt_help(); printf("testpi-2 specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -61,9 +57,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -203,20 +196,13 @@ int main(int argc, char* argv[]) { CPU_ZERO(&mask); CPU_SET(0, &mask); setup(); - rt_init("jh",parse_args,argc,argv); + rt_init("h",parse_args,argc,argv); if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { printf("pthread_barrier_init failed: %s\n", strerror(retc)); exit(retc); } - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - retc = sched_setaffinity(0, sizeof(mask), &mask); if (retc < 0) { printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); Index: ltp/testcases/realtime/func/pi-tests/testpi-4.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-4.c +++ ltp/testcases/realtime/func/pi-tests/testpi-4.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * @@ -45,16 +44,13 @@ #include <sys/syscall.h> #include <unistd.h> #include <librttest.h> -#include <libjvmsim.h> -static int run_jvmsim=0; pthread_barrier_t barrier; void usage(void) { rt_help(); printf("testpi-4 specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -62,9 +58,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -204,20 +197,13 @@ int main(int argc, char* argv[]) { CPU_SET(0, &mask); setup(); - rt_init("jh",parse_args,argc,argv); + rt_init("h",parse_args,argc,argv); if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { printf("pthread_barrier_init failed: %s\n", strerror(retc)); exit(retc); } - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - retc = sched_setaffinity(0, sizeof(mask), &mask); if (retc < 0) { printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); Index: ltp/testcases/realtime/func/pi-tests/testpi-5.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-5.c +++ ltp/testcases/realtime/func/pi-tests/testpi-5.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Index: ltp/testcases/realtime/func/pi-tests/testpi-6.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-6.c +++ ltp/testcases/realtime/func/pi-tests/testpi-6.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Index: ltp/testcases/realtime/func/pi-tests/testpi-7.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/testpi-7.c +++ ltp/testcases/realtime/func/pi-tests/testpi-7.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -42,7 +41,6 @@ #include <stdlib.h> #include <math.h> #include <librttest.h> -#include <libjvmsim.h> #define HIGH_PRIO 15 #define MED_PRIO 10 @@ -74,14 +72,12 @@ static volatile phase_t phase_flag = END static pthread_mutex_t flag_mutex; int med_threads = 0; -static int run_jvmsim=0; long iterations = ITERATIONS; void usage(void) { rt_help(); printf("testpi-7 specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -i# #: number of iterations\n"); printf(" -f #: Use flag mutex\n"); printf(" -m# #:number of mid priority threads\n"); @@ -91,9 +87,6 @@ int parse_args(int c, char *v) { int handled = 1; switch (c) { - case 'j': - run_jvmsim=1; - break; case 'h': usage(); exit(0); @@ -253,14 +246,7 @@ int main(int argc, char *argv[]) int i,numcpus; setup(); - rt_init("jhfi:m:", parse_args, argc, argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("hfi:m:", parse_args, argc, argv); if (!med_threads) { printf("This test requires that at least NRCPUS medium priority threads run\n"); Index: ltp/testcases/realtime/func/pi-tests/sbrk_mutex.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/sbrk_mutex.c +++ ltp/testcases/realtime/func/pi-tests/sbrk_mutex.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -45,7 +44,6 @@ #include <errno.h> #include <unistd.h> #include <librttest.h> -#include <libjvmsim.h> #define NUM_MUTEXES 5000 #define NUM_THREADS 50 @@ -54,13 +52,11 @@ static pthread_mutex_t *mutexes[NUM_MUTEXES]; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("sbrk_mutex specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -68,9 +64,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -110,14 +103,7 @@ int main(int argc, char* argv[]) pthread_mutexattr_t mutexattr; setup(); - rt_init("jh",parse_args,argc,argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("h",parse_args,argc,argv); if (pthread_mutexattr_init(&mutexattr) != 0) { printf("Failed to init mutexattr\n"); Index: ltp/testcases/realtime/func/pi-tests/test-skeleton.c =================================================================== --- ltp.orig/testcases/realtime/func/pi-tests/test-skeleton.c +++ ltp/testcases/realtime/func/pi-tests/test-skeleton.c @@ -25,7 +25,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * @@ -43,15 +42,12 @@ #include <sys/wait.h> #include <time.h> #include <librttest.h> -#include <libjvmsim.h> -static int run_jvmsim=0; void usage(void) { rt_help(); printf("testpi-5 and 6 specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -59,9 +55,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -106,15 +99,8 @@ int main(int argc, char **argv) int status; setup(); - rt_init("jh",parse_args,argc,argv); + rt_init("h",parse_args,argc,argv); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - pid = fork(); if ( 0 == pid) { //This is the child Index: ltp/testcases/realtime/func/prio-preempt/prio-preempt.c =================================================================== --- ltp.orig/testcases/realtime/func/prio-preempt/prio-preempt.c +++ ltp/testcases/realtime/func/prio-preempt/prio-preempt.c @@ -49,7 +49,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Dinakar Guniguntala <di...@us...> @@ -85,7 +84,6 @@ static pthread_cond_t cond[NUM_WORKERS+1 static int t_after_wait[NUM_WORKERS]; static int ret = 0; -static int run_jvmsim=0; pthread_barrier_t barrier; @@ -93,7 +91,6 @@ void usage(void) { rt_help(); printf("prio-preempt specific options:\n"); - printf(" -j # :enable jvmsim\n"); printf(" -i #: enable interrupter threads\n"); printf(" -n# #: number of busy threads\n"); } @@ -103,9 +100,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -294,7 +288,7 @@ int main(int argc, char* argv[]) setup(); pass_criteria = CHECK_LIMIT; - rt_init("jhin:", parse_args, argc, argv); + rt_init("hin:", parse_args, argc, argv); numcpus = sysconf(_SC_NPROCESSORS_ONLN); Index: ltp/testcases/realtime/func/prio-wake/prio-wake.c =================================================================== --- ltp.orig/testcases/realtime/func/prio-wake/prio-wake.c +++ ltp/testcases/realtime/func/prio-wake/prio-wake.c @@ -54,8 +54,6 @@ #include <errno.h> #include <sys/syscall.h> #include <librttest.h> -#include <libjvmsim.h> - volatile int running_threads = 0; static int rt_threads = 0; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; @@ -63,13 +61,11 @@ static pthread_mutex_t mutex; static volatile nsec_t beginrun; static int ret = 0; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("prio-wake specific options:\n"); - printf(" -j #: enable jvmsim\n"); printf(" -n# #: number of worker threads\n"); } @@ -78,9 +74,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -168,14 +161,7 @@ int main(int argc, char* argv[]) int i; setup(); - rt_init("jhn:", parse_args, argc, argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("hn:", parse_args, argc, argv); if (rt_threads == 0) { numcpus = sysconf(_SC_NPROCESSORS_ONLN); Index: ltp/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c =================================================================== --- ltp.orig/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c +++ ltp/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c @@ -51,7 +51,6 @@ #include <signal.h> #include <errno.h> #include <librttest.h> -#include <libjvmsim.h> #include <libstats.h> #define PRIO 89 @@ -69,13 +68,11 @@ int fail; atomic_t flag; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("pthread_kill_latency specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -l threshold trace latency with given threshold in us\n"); } @@ -84,9 +81,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'l': latency_threshold = strtoull(v, NULL, 0); break; @@ -281,7 +275,7 @@ int main(int argc, char *argv[]) setup(); pass_criteria = THRESHOLD; - rt_init("jl:h", parse_args, argc, argv); /* we need the buffered print system */ + rt_init("l:h", parse_args, argc, argv); /* we need the buffered print system */ printf("-------------------------------\n"); printf("pthread_kill Latency\n"); @@ -289,13 +283,6 @@ int main(int argc, char *argv[]) printf("Iterations: %d\n", ITERATIONS); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - debug(DBG_DEBUG, "Main creating threads\n"); fflush(stdout); Index: ltp/testcases/realtime/func/sched_football/sched_football.c =================================================================== --- ltp.orig/testcases/realtime/func/sched_football/sched_football.c +++ ltp/testcases/realtime/func/sched_football/sched_football.c @@ -41,7 +41,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * John Stultz <johnstul@xxxxxxxxx > @@ -66,7 +65,6 @@ #include <unistd.h> #include <sys/time.h> #include <librttest.h> -#include <libjvmsim.h> #define DEF_GAME_LENGTH 5 @@ -76,7 +74,6 @@ volatile int the_ball; /* pthread_barrier for synchronization */ pthread_barrier_t barrier; -static int run_jvmsim=0; static int players_per_team = 0; static int game_length = DEF_GAME_LENGTH; @@ -84,7 +81,6 @@ void usage(void) { rt_help(); printf("sched_football specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -nPLAYERS players per team (defaults to num_cpus)\n"); printf(" -lGAME_LENGTH game length in seconds (defaults to %d s)\n", DEF_GAME_LENGTH); @@ -95,9 +91,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -171,18 +164,11 @@ int main(int argc, char* argv[]) int i; setup(); - rt_init("n:l:jh",parse_args,argc,argv); + rt_init("n:l:h",parse_args,argc,argv); if (players_per_team == 0) players_per_team = sysconf(_SC_NPROCESSORS_ONLN); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - if ((i = pthread_barrier_init(&barrier, NULL, players_per_team*2 + 1))) { printf("pthread_barrier_init failed: %s\n", strerror(i)); exit(i); Index: ltp/testcases/realtime/func/sched_jitter/sched_jitter.c =================================================================== --- ltp.orig/testcases/realtime/func/sched_jitter/sched_jitter.c +++ ltp/testcases/realtime/func/sched_jitter/sched_jitter.c @@ -31,7 +31,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * John Stultz <joh...@us...> @@ -49,7 +48,6 @@ #include <unistd.h> #include <libstats.h> #include <librttest.h> -#include <libjvmsim.h> #define NUMRUNS 1000 #define NUMLOOPS 1000000 @@ -61,13 +59,11 @@ int array[WORKLEN]; volatile int flag; /*let interrupter know we're done */ -static int run_jvmsim=0; void usage(void) { rt_help(); printf("sched_jitter specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -75,9 +71,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -176,14 +169,7 @@ int main(int argc, char *argv[]) setup(); - rt_init("jh",parse_args,argc,argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("h",parse_args,argc,argv); interrupter = create_fifo_thread(thread_interrupter, NULL, 80); sleep(1); Index: ltp/testcases/realtime/func/sched_latency/sched_latency.c =================================================================== --- ltp.orig/testcases/realtime/func/sched_latency/sched_latency.c +++ ltp/testcases/realtime/func/sched_latency/sched_latency.c @@ -34,7 +34,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -51,7 +50,6 @@ #include <math.h> #include <librttest.h> #include <libstats.h> -#include <libjvmsim.h> #define PRIO 89 //#define PERIOD 17*NS_PER_MS @@ -66,7 +64,6 @@ nsec_t start; nsec_t end; -static int run_jvmsim = 0; static int ret = 0; static int iterations = 0; static unsigned long long latency_threshold = 0; @@ -81,7 +78,6 @@ void usage(void) { rt_help(); printf("sched_latency specific options:\n"); - printf(" -j enable jvmsim\n"); printf(" -dLOAD periodic load in ms (default 1)\n"); printf(" -lTHRESHOLD trace latency, with given threshold in us\n"); printf(" -tPERIOD period in ms (default 5)\n"); @@ -94,9 +90,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -235,7 +228,7 @@ int main(int argc, char *argv[]) setup(); pass_criteria = PASS_US; - rt_init("d:jl:ht:i:", parse_args, argc, argv); + rt_init("d:l:ht:i:", parse_args, argc, argv); printf("-------------------------------\n"); printf("Scheduling Latency\n"); @@ -260,13 +253,6 @@ int main(int argc, char *argv[]) printf("Expected running time: %d s\n", (int)(iterations*((float)period / NS_PER_SEC))); - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } - if (stats_container_init(&dat, iterations)) exit(1); Index: ltp/testcases/realtime/func/thread_clock/tc-2.c =================================================================== --- ltp.orig/testcases/realtime/func/thread_clock/tc-2.c +++ ltp/testcases/realtime/func/thread_clock/tc-2.c @@ -31,7 +31,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Sripathi Kodi <sri...@in...> @@ -48,7 +47,6 @@ #include <stdlib.h> #include <unistd.h> #include <librttest.h> -#include <libjvmsim.h> #define NS_PER_SEC 1000000000 #define THRESHOLD 0.5 /* 500 milliseconds */ @@ -57,22 +55,17 @@ struct timespec sleepts[NUMSLEEP]; struct timespec workts[NUMWORK]; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("thread_clock specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) { int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -184,14 +177,7 @@ int main(int argc,char* argv[]) setup(); pass_criteria = THRESHOLD; - rt_init("jht:",parse_args,argc,argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("ht:",parse_args,argc,argv); /* Start sleeper threads */ for (i=0; i<NUMSLEEP; i++) { Index: ltp/testcases/realtime/perf/latency/pthread_cond_latency.c =================================================================== --- ltp.orig/testcases/realtime/perf/latency/pthread_cond_latency.c +++ ltp/testcases/realtime/perf/latency/pthread_cond_latency.c @@ -24,7 +24,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Paul E. McKenney <pa...@us...> @@ -43,19 +42,16 @@ #include <unistd.h> #include <stdlib.h> #include <librttest.h> -#include <libjvmsim.h> pthread_mutex_t child_mutex = PTHREAD_MUTEX_INITIALIZER; volatile int child_waiting = 0; double endtime; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("testpi-1 specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -63,9 +59,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -206,14 +199,7 @@ main(int argc, char *argv[]) long iter; setup(); - rt_init("jh", parse_args, argc, argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("h", parse_args, argc, argv); sp.sched_priority = sched_get_priority_max(SCHED_FIFO); if (sp.sched_priority == -1) { Index: ltp/testcases/realtime/stress/pi-tests/lookup_pi_state.c =================================================================== --- ltp.orig/testcases/realtime/stress/pi-tests/lookup_pi_state.c +++ ltp/testcases/realtime/stress/pi-tests/lookup_pi_state.c @@ -24,7 +24,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * Darren Hart <dv...@us...> @@ -36,12 +35,10 @@ #include <stdio.h> #include <librttest.h> -#include <libjvmsim.h> #define NUM_SLAVES 20 #define SLAVE_PRIO 89 -int enable_jvmsim = 0; pthread_mutex_t MM; pthread_mutex_t MS; @@ -54,13 +51,11 @@ atomic_t slave_order_a = {0}; atomic_t slave_order_b = {0}; atomic_t slave_order_c = {0}; -static int run_jvmsim=0; void usage(void) { rt_help(); printf("lookup_pi_state specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -68,9 +63,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -180,15 +172,7 @@ int main(int argc, char *argv[]) pthread_cond_init(&CS, NULL); pthread_cond_init(&CT, NULL); - rt_init("jh", parse_args, argc, argv); - - // -j to enable jvmsim - if (run_jvmsim) { - printf("jvmsim Enabled\n"); - jvmsim_init(); - } else { - printf("jvmsim disabled \n"); - } + rt_init("h", parse_args, argc, argv); create_other_thread(master_thread, (void *)0); Index: ltp/testcases/realtime/stress/pi-tests/testpi-3.c =================================================================== --- ltp.orig/testcases/realtime/stress/pi-tests/testpi-3.c +++ ltp/testcases/realtime/stress/pi-tests/testpi-3.c @@ -24,7 +24,6 @@ * * USAGE: * Use run_auto.sh script in current directory to build and run test. - * Use "-j" to enable jvm simulator. * * AUTHOR * @@ -43,15 +42,11 @@ #include <sys/syscall.h> #include <unistd.h> #include <librttest.h> -#include <libjvmsim.h> - -static int run_jvmsim=0; void usage(void) { rt_help(); printf("testpi-3 specific options:\n"); - printf(" -j enable jvmsim\n"); } int parse_args(int c, char *v) @@ -59,9 +54,6 @@ int parse_args(int c, char *v) int handled = 1; switch (c) { - case 'j': - run_jvmsim = 1; - break; case 'h': usage(); exit(0); @@ -322,14 +314,7 @@ int main(int argc, char* argv[]) { CPU_SET(0, &mask); setup(); - rt_init("jh",parse_args,argc,argv); - - if (run_jvmsim) { - printf("jvmsim enabled\n"); - jvmsim_init(); // Start the JVM simulation - } else { - printf("jvmsim disabled\n"); - } + rt_init("h",parse_args,argc,argv); retc = sched_setaffinity(0, sizeof(mask), &mask); if (retc < 0) { -- -Thanks,Chirag |
From: Subrata M. <su...@li...> - 2008-11-28 10:42:44
|
On Wed, 2008-11-26 at 10:37 +0530, Chirag Jog wrote: > Most of the testcases, have an option (-j) which runs > the jvmsim as a background load so as to simulate the > behavior of the JVM. > This patch removes the references of jvmsim from all > the testcases. > > > Signed-Off-By: Chirag <ch...@li...> > Acked-by: Sripathi Kodi <sri...@in...> Thanks. Regards-- Subrata > > > > func/async_handler/async_handler.c | 15 +-------------- > func/async_handler/async_handler_jk.c | 15 +-------------- > func/async_handler/async_handler_tsc.c | 16 +--------------- > func/gtod_latency/gtod_infinite.c | 16 +--------------- > func/gtod_latency/gtod_latency.c | 1 - > func/hrtimer-prio/hrtimer-prio.c | 14 -------------- > func/matrix_mult/matrix_mult.c | 16 +--------------- > func/measurement/preempt_timing.c | 16 +--------------- > func/periodic_cpu_load/periodic_cpu_load.c | 15 +-------------- > func/periodic_cpu_load/periodic_cpu_load_single.c | 16 +--------------- > func/pi-tests/sbrk_mutex.c | 16 +--------------- > func/pi-tests/test-skeleton.c | 16 +--------------- > func/pi-tests/testpi-0.c | 1 - > func/pi-tests/testpi-1.c | 16 +--------------- > func/pi-tests/testpi-2.c | 16 +--------------- > func/pi-tests/testpi-4.c | 16 +--------------- > func/pi-tests/testpi-5.c | 1 - > func/pi-tests/testpi-6.c | 1 - > func/pi-tests/testpi-7.c | 16 +--------------- > func/prio-preempt/prio-preempt.c | 8 +------- > func/prio-wake/prio-wake.c | 16 +--------------- > func/pthread_kill_latency/pthread_kill_latency.c | 15 +-------------- > func/sched_football/sched_football.c | 16 +--------------- > func/sched_jitter/sched_jitter.c | 16 +--------------- > func/sched_latency/sched_latency.c | 16 +--------------- > func/thread_clock/tc-2.c | 16 +--------------- > perf/latency/pthread_cond_latency.c | 16 +--------------- > stress/pi-tests/lookup_pi_state.c | 18 +----------------- > stress/pi-tests/testpi-3.c | 17 +---------------- > 29 files changed, 24 insertions(+), 369 deletions(-) > > Index: ltp/testcases/realtime/func/async_handler/async_handler.c > =================================================================== > --- ltp.orig/testcases/realtime/func/async_handler/async_handler.c > +++ ltp/testcases/realtime/func/async_handler/async_handler.c > @@ -26,7 +26,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -40,7 +39,6 @@ > #include <stdlib.h> > #include <math.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <libstats.h> > #include <getopt.h> > > @@ -53,7 +51,6 @@ > static nsec_t start; > static nsec_t end; > static int iterations = 0; > -static int run_jvmsim = 0; > > #define CHILD_START 0 > #define CHILD_WAIT 1 > @@ -70,7 +67,6 @@ void usage(void) > { > rt_help(); > printf("async_handler specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -iITERATIONS number of iterations to calculate the average over\n"); > } > > @@ -79,9 +75,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -181,18 +174,12 @@ int main(int argc, char *argv[]) > printf("-----------------------------------\n\n"); > > pass_criteria = PASS_US; > - rt_init("ji:h", parse_args, argc, argv); > + rt_init("i:h", parse_args, argc, argv); > > init_pi_mutex(&mutex); > > atomic_set(CHILD_START, &step); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > if (iterations == 0) > iterations = DEFAULT_ITERATIONS; > printf("Running %d iterations\n", iterations); > Index: ltp/testcases/realtime/func/async_handler/async_handler_jk.c > =================================================================== > --- ltp.orig/testcases/realtime/func/async_handler/async_handler_jk.c > +++ ltp/testcases/realtime/func/async_handler/async_handler_jk.c > @@ -29,7 +29,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * John Kacur <jk...@ca...> > @@ -43,7 +42,6 @@ > #include <stdlib.h> > #include <math.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <libstats.h> > > // This is the normal priority for an event handler if not specified. > @@ -52,7 +50,6 @@ > #define PASS_US 100 > > long start, end; > -static int run_jvmsim = 0; > > /* Function Prototypes */ > void *async_event_server(void *arg); > @@ -62,7 +59,6 @@ void usage(void) > { > rt_help(); > printf("async_handler_jk specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -70,9 +66,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -149,13 +142,7 @@ int main(int argc, char* argv[]) > setup(); > > pass_criteria = PASS_US; > - rt_init("jh", parse_args, argc, argv); > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("h", parse_args, argc, argv); > > aes_id = create_fifo_thread(async_event_server, (void*)0, 83); > server = get_thread(aes_id); > Index: ltp/testcases/realtime/func/async_handler/async_handler_tsc.c > =================================================================== > --- ltp.orig/testcases/realtime/func/async_handler/async_handler_tsc.c > +++ ltp/testcases/realtime/func/async_handler/async_handler_tsc.c > @@ -29,7 +29,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -45,7 +44,6 @@ > #include <stdint.h> > #include <pthread.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <libstats.h> > > #define HANDLER_PRIO 98 > @@ -71,13 +69,11 @@ pthread_cond_t cond = PTHREAD_COND_INITI > pthread_mutex_t mutex; > > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("async_handler_tsc specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -85,9 +81,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -199,7 +192,7 @@ int main(int argc, char *argv[]) > int signal_id, handler_id; > setup(); > > - rt_init("jh", parse_args, argc, argv); > + rt_init("h", parse_args, argc, argv); > > printf("-------------------------------\n"); > printf("Asynchronous Event Handling Latency\n"); > @@ -213,13 +206,6 @@ int main(int argc, char *argv[]) > init_pi_mutex(&mutex); > > atomic_set(CHILD_START, &step); > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > handler_id = create_fifo_thread(handler_thread, (void*)0, HANDLER_PRIO); > signal_id = create_fifo_thread(signal_thread, (void*)0, SIGNAL_PRIO); > > Index: ltp/testcases/realtime/func/gtod_latency/gtod_infinite.c > =================================================================== > --- ltp.orig/testcases/realtime/func/gtod_latency/gtod_infinite.c > +++ ltp/testcases/realtime/func/gtod_latency/gtod_infinite.c > @@ -37,7 +37,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -52,7 +51,6 @@ > #include <time.h> > #include <sched.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <sys/mman.h> > > /* #define CLOCK_TO_USE CLOCK_MONOTONIC */ > @@ -61,14 +59,12 @@ > #define START_MAX 3000 > #define REPORT_MIN 1000000 > > -static int run_jvmsim = 0; > static unsigned int max_window = 0; /* infinite, don't use a window */ > > void usage(void) > { > rt_help(); > printf("gtod_infinite specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -wWINDOW iterations in max value window (default inf)\n"); > } > > @@ -76,9 +72,6 @@ int parse_args(int c, char *v) > { > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -113,14 +106,7 @@ int main(int argc, char *argv[]) > exit(1); > } > */ > - rt_init("jhw:", parse_args, argc, argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("hw:", parse_args, argc, argv); > > mlockall(MCL_CURRENT|MCL_FUTURE); > > Index: ltp/testcases/realtime/func/gtod_latency/gtod_latency.c > =================================================================== > --- ltp.orig/testcases/realtime/func/gtod_latency/gtod_latency.c > +++ ltp/testcases/realtime/func/gtod_latency/gtod_latency.c > @@ -30,7 +30,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > Index: ltp/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c > =================================================================== > --- ltp.orig/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c > +++ ltp/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c > @@ -29,7 +29,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -43,7 +42,6 @@ > #include <stdlib.h> > #include <math.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <libstats.h> > > #define DEF_MED_PRIO 60 // (softirqd-hrtimer,98) > @@ -53,7 +51,6 @@ > #define DEF_SLEEP_TIME 10000 // Duration of nanosleep in nanoseconds > #define DEF_CRITERIA 10 // maximum timer latency in microseconds > > -static int run_jvmsim = 0; > static int med_prio = DEF_MED_PRIO; > static int high_prio; > static int busy_time = DEF_BUSY_TIME; > @@ -69,7 +66,6 @@ void usage(void) > { > rt_help(); > printf("hrtimer-prio specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -t# #:busy work time in ms, defaults to %d ms\n", DEF_BUSY_TIME); > printf(" -i# #:number of iterations, defaults to %d\n", DEF_ITERATIONS); > printf(" -n# #:number of busy threads, defaults to NR_CPUS*2\n"); > @@ -82,9 +78,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -175,13 +168,6 @@ int main(int argc, char *argv[]) > printf("Busy thread priority: %d\n", med_prio); > printf("Timer thread priority: %d\n", high_prio); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > stats_container_t hist; > stats_quantiles_t quantiles; > if (stats_container_init(&dat, iterations)) { > Index: ltp/testcases/realtime/func/matrix_mult/matrix_mult.c > =================================================================== > --- ltp.orig/testcases/realtime/func/matrix_mult/matrix_mult.c > +++ ltp/testcases/realtime/func/matrix_mult/matrix_mult.c > @@ -26,7 +26,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -41,7 +40,6 @@ > #include <stdlib.h> > #include <math.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <libstats.h> > > #define MAX_CPUS 8192 > @@ -60,7 +58,6 @@ > > #define THREAD_SLEEP 1 * NS_PER_US > > -static int run_jvmsim = 0; > static int ops = DEF_OPS; > static int numcpus; > static float criteria; > @@ -79,7 +76,6 @@ void usage(void) > { > rt_help(); > printf("matrix_mult specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -l# #: number of multiplications per iteration (load)\n"); > printf(" -i# #: number of iterations\n"); > } > @@ -88,9 +84,6 @@ int parse_args(int c, char *v) > { > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'i': > iterations = atoi(v); > break; > @@ -317,7 +310,7 @@ int main(int argc, char *argv[]) > { > setup(); > pass_criteria = PASS_CRITERIA; > - rt_init("jl:i:h", parse_args, argc, argv); > + rt_init("l:i:h", parse_args, argc, argv); > numcpus = sysconf(_SC_NPROCESSORS_ONLN); > /* the minimum avg concurrent multiplier to pass */ > criteria = pass_criteria * numcpus; > @@ -348,13 +341,6 @@ int main(int argc, char *argv[]) > printf("Calculations per iteration: %d\n", ops); > printf("Number of CPUs: %u\n", numcpus); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); /* Start the JVM simulation */ > - } else { > - printf("jvmsim disabled\n"); > - } > - > set_priority(PRIO); > main_thread(); > > Index: ltp/testcases/realtime/func/measurement/preempt_timing.c > =================================================================== > --- ltp.orig/testcases/realtime/func/measurement/preempt_timing.c > +++ ltp/testcases/realtime/func/measurement/preempt_timing.c > @@ -32,7 +32,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > @@ -53,19 +52,16 @@ > #include <sys/mman.h> > #include <stdint.h> > #include <librttest.h> > -#include <libjvmsim.h> > > > #define ITERATIONS 1000000ULL > #define INTERVALS 10 > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("preempt_timing specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -73,9 +69,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -97,14 +90,7 @@ int main(int argc, char *argv[]) > min = -1; > setup(); > > - rt_init("jh",parse_args,argc,argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("h",parse_args,argc,argv); > > /* switch to SCHED_FIFO 99 */ > param.sched_priority = sched_get_priority_max(SCHED_FIFO); > Index: ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load.c > =================================================================== > --- ltp.orig/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load.c > +++ ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -40,7 +39,6 @@ > #include <math.h> > #include <librttest.h> > #include <libstats.h> > -#include <libjvmsim.h> > > #define PRIO_A 63 > #define PRIO_B 53 > @@ -68,7 +66,6 @@ stats_container_t dat[THREADS_PER_GROUP > stats_quantiles_t quantiles[THREADS_PER_GROUP * NUM_GROUPS]; > static const char groupname[NUM_GROUPS] = "ABC"; > > -static int run_jvmsim = 0; > static int iterations = ITERATIONS; > static int ret = 0; > > @@ -77,15 +74,12 @@ void usage(void) > rt_help(); > printf("periodic_cpu_load specific options:\n"); > printf(" -iITERATIONS number of iterations to calculate the average over\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > { > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > break; > case 'i': > iterations = atoi(v); > @@ -170,7 +164,7 @@ int main(int argc, char *argv[]) > int i; > setup(); > > - rt_init("jhi:", parse_args, argc, argv); > + rt_init("hi:", parse_args, argc, argv); > > if (iterations < 100) { > fprintf(stderr, "Number of iteration cannot be less than 100.\n"); > @@ -195,13 +189,6 @@ int main(int argc, char *argv[]) > printf(" period: %d ms\n", PERIOD_C/NS_PER_MS); > printf("\n"); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > for (i=0; i<(THREADS_PER_GROUP * NUM_GROUPS); i++) { > stats_container_init(&dat[i], iterations); > stats_quantiles_init(&quantiles[i], (int)log10(iterations)); > Index: ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load_single.c > =================================================================== > --- ltp.orig/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load_single.c > +++ ltp/testcases/realtime/func/periodic_cpu_load/periodic_cpu_load_single.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -40,7 +39,6 @@ > #include <math.h> > #include <librttest.h> > #include <libstats.h> > -#include <libjvmsim.h> > > #define HIST_BUCKETS 100 > > @@ -55,7 +53,6 @@ > static int prio; > static int period; > static int calc_loops; > -static int run_jvmsim = 0; > static int ret = 0; > static char *filename_prefix = DEFAULT_FILENAME_PREFIX; > static int iterations = DEFAULT_ITERATIONS; > @@ -67,7 +64,6 @@ void usage(void) > printf(" -lCALC_LOOPS loops per iteration\n"); > printf(" -fFILENAME_PREFIX filename prefix for plot output\n"); > printf(" -iITERATIONS number of iterations to calculate the average over\n"); > - printf(" -j enable jvmsim\n"); > printf(" -r[0-99] real-time priority\n"); > printf(" -tPERIOD period in ms\n"); > } > @@ -175,9 +171,6 @@ int parse_args(int c, char *v) > case 'i': > iterations = atoi(v); > break; > - case 'j': > - run_jvmsim = 1; > - break; > case 'r': > prio = atoi(v); > break; > @@ -198,7 +191,7 @@ int main(int argc, char *argv[]) > calc_loops = DEFAULT_CALC_LOOPS; > setup(); > > - rt_init("f:jhi:r:t:l:", parse_args, argc, argv); > + rt_init("f:hi:r:t:l:", parse_args, argc, argv); > > if (iterations < 100) { > printf("Number of iterations cannot be less than 100\n"); > @@ -221,13 +214,6 @@ int main(int argc, char *argv[]) > printf(" loops: %d\n", calc_loops); > printf(" logs: %s*\n", filename_prefix); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > ret = periodic_thread(period, iterations, calc_loops); > > return ret; > Index: ltp/testcases/realtime/func/pi-tests/testpi-0.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-0.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-0.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > Index: ltp/testcases/realtime/func/pi-tests/testpi-1.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-1.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-1.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > @@ -44,16 +43,13 @@ > #include <sys/syscall.h> > #include <unistd.h> > #include <librttest.h> > -#include <libjvmsim.h> > > -static int run_jvmsim=0; > pthread_barrier_t barrier; > > void usage(void) > { > rt_help(); > printf("testpi-1 specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -61,9 +57,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -204,20 +197,13 @@ int main(int argc, char* argv[]) { > CPU_SET(0, &mask); > setup(); > > - rt_init("jh",parse_args,argc,argv); > + rt_init("h",parse_args,argc,argv); > > if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { > printf("pthread_barrier_init failed: %s\n", strerror(retc)); > exit(retc); > } > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > retc = sched_setaffinity(0, sizeof(mask), &mask); > if (retc < 0) { > printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); > Index: ltp/testcases/realtime/func/pi-tests/testpi-2.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-2.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-2.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > @@ -44,16 +43,13 @@ > #include <sys/syscall.h> > #include <unistd.h> > #include <librttest.h> > -#include <libjvmsim.h> > > -static int run_jvmsim=0; > pthread_barrier_t barrier; > > void usage(void) > { > rt_help(); > printf("testpi-2 specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -61,9 +57,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -203,20 +196,13 @@ int main(int argc, char* argv[]) { > CPU_ZERO(&mask); > CPU_SET(0, &mask); > setup(); > - rt_init("jh",parse_args,argc,argv); > + rt_init("h",parse_args,argc,argv); > > if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { > printf("pthread_barrier_init failed: %s\n", strerror(retc)); > exit(retc); > } > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > retc = sched_setaffinity(0, sizeof(mask), &mask); > if (retc < 0) { > printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); > Index: ltp/testcases/realtime/func/pi-tests/testpi-4.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-4.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-4.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > @@ -45,16 +44,13 @@ > #include <sys/syscall.h> > #include <unistd.h> > #include <librttest.h> > -#include <libjvmsim.h> > > -static int run_jvmsim=0; > pthread_barrier_t barrier; > > void usage(void) > { > rt_help(); > printf("testpi-4 specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -62,9 +58,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -204,20 +197,13 @@ int main(int argc, char* argv[]) { > CPU_SET(0, &mask); > setup(); > > - rt_init("jh",parse_args,argc,argv); > + rt_init("h",parse_args,argc,argv); > > if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { > printf("pthread_barrier_init failed: %s\n", strerror(retc)); > exit(retc); > } > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > retc = sched_setaffinity(0, sizeof(mask), &mask); > if (retc < 0) { > printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); > Index: ltp/testcases/realtime/func/pi-tests/testpi-5.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-5.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-5.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > Index: ltp/testcases/realtime/func/pi-tests/testpi-6.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-6.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-6.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > Index: ltp/testcases/realtime/func/pi-tests/testpi-7.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/testpi-7.c > +++ ltp/testcases/realtime/func/pi-tests/testpi-7.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -42,7 +41,6 @@ > #include <stdlib.h> > #include <math.h> > #include <librttest.h> > -#include <libjvmsim.h> > > #define HIGH_PRIO 15 > #define MED_PRIO 10 > @@ -74,14 +72,12 @@ static volatile phase_t phase_flag = END > static pthread_mutex_t flag_mutex; > > int med_threads = 0; > -static int run_jvmsim=0; > long iterations = ITERATIONS; > > void usage(void) > { > rt_help(); > printf("testpi-7 specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -i# #: number of iterations\n"); > printf(" -f #: Use flag mutex\n"); > printf(" -m# #:number of mid priority threads\n"); > @@ -91,9 +87,6 @@ int parse_args(int c, char *v) > { > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim=1; > - break; > case 'h': > usage(); > exit(0); > @@ -253,14 +246,7 @@ int main(int argc, char *argv[]) > int i,numcpus; > setup(); > > - rt_init("jhfi:m:", parse_args, argc, argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("hfi:m:", parse_args, argc, argv); > > if (!med_threads) { > printf("This test requires that at least NRCPUS medium priority threads run\n"); > Index: ltp/testcases/realtime/func/pi-tests/sbrk_mutex.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/sbrk_mutex.c > +++ ltp/testcases/realtime/func/pi-tests/sbrk_mutex.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -45,7 +44,6 @@ > #include <errno.h> > #include <unistd.h> > #include <librttest.h> > -#include <libjvmsim.h> > > #define NUM_MUTEXES 5000 > #define NUM_THREADS 50 > @@ -54,13 +52,11 @@ > > static pthread_mutex_t *mutexes[NUM_MUTEXES]; > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("sbrk_mutex specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -68,9 +64,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -110,14 +103,7 @@ int main(int argc, char* argv[]) > pthread_mutexattr_t mutexattr; > setup(); > > - rt_init("jh",parse_args,argc,argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("h",parse_args,argc,argv); > > if (pthread_mutexattr_init(&mutexattr) != 0) { > printf("Failed to init mutexattr\n"); > Index: ltp/testcases/realtime/func/pi-tests/test-skeleton.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pi-tests/test-skeleton.c > +++ ltp/testcases/realtime/func/pi-tests/test-skeleton.c > @@ -25,7 +25,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > @@ -43,15 +42,12 @@ > #include <sys/wait.h> > #include <time.h> > #include <librttest.h> > -#include <libjvmsim.h> > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("testpi-5 and 6 specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -59,9 +55,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -106,15 +99,8 @@ int main(int argc, char **argv) > int status; > setup(); > > - rt_init("jh",parse_args,argc,argv); > + rt_init("h",parse_args,argc,argv); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > pid = fork(); > if ( 0 == pid) { > //This is the child > Index: ltp/testcases/realtime/func/prio-preempt/prio-preempt.c > =================================================================== > --- ltp.orig/testcases/realtime/func/prio-preempt/prio-preempt.c > +++ ltp/testcases/realtime/func/prio-preempt/prio-preempt.c > @@ -49,7 +49,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Dinakar Guniguntala <di...@us...> > @@ -85,7 +84,6 @@ static pthread_cond_t cond[NUM_WORKERS+1 > static int t_after_wait[NUM_WORKERS]; > > static int ret = 0; > -static int run_jvmsim=0; > > pthread_barrier_t barrier; > > @@ -93,7 +91,6 @@ void usage(void) > { > rt_help(); > printf("prio-preempt specific options:\n"); > - printf(" -j # :enable jvmsim\n"); > printf(" -i #: enable interrupter threads\n"); > printf(" -n# #: number of busy threads\n"); > } > @@ -103,9 +100,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -294,7 +288,7 @@ int main(int argc, char* argv[]) > setup(); > > pass_criteria = CHECK_LIMIT; > - rt_init("jhin:", parse_args, argc, argv); > + rt_init("hin:", parse_args, argc, argv); > > numcpus = sysconf(_SC_NPROCESSORS_ONLN); > > Index: ltp/testcases/realtime/func/prio-wake/prio-wake.c > =================================================================== > --- ltp.orig/testcases/realtime/func/prio-wake/prio-wake.c > +++ ltp/testcases/realtime/func/prio-wake/prio-wake.c > @@ -54,8 +54,6 @@ > #include <errno.h> > #include <sys/syscall.h> > #include <librttest.h> > -#include <libjvmsim.h> > - > volatile int running_threads = 0; > static int rt_threads = 0; > static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; > @@ -63,13 +61,11 @@ static pthread_mutex_t mutex; > static volatile nsec_t beginrun; > > static int ret = 0; > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("prio-wake specific options:\n"); > - printf(" -j #: enable jvmsim\n"); > printf(" -n# #: number of worker threads\n"); > } > > @@ -78,9 +74,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -168,14 +161,7 @@ int main(int argc, char* argv[]) > int i; > setup(); > > - rt_init("jhn:", parse_args, argc, argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("hn:", parse_args, argc, argv); > > if (rt_threads == 0) { > numcpus = sysconf(_SC_NPROCESSORS_ONLN); > Index: ltp/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c > =================================================================== > --- ltp.orig/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c > +++ ltp/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c > @@ -51,7 +51,6 @@ > #include <signal.h> > #include <errno.h> > #include <librttest.h> > -#include <libjvmsim.h> > #include <libstats.h> > > #define PRIO 89 > @@ -69,13 +68,11 @@ int fail; > > atomic_t flag; > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("pthread_kill_latency specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -l threshold trace latency with given threshold in us\n"); > } > > @@ -84,9 +81,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'l': > latency_threshold = strtoull(v, NULL, 0); > break; > @@ -281,7 +275,7 @@ int main(int argc, char *argv[]) > setup(); > > pass_criteria = THRESHOLD; > - rt_init("jl:h", parse_args, argc, argv); /* we need the buffered print system */ > + rt_init("l:h", parse_args, argc, argv); /* we need the buffered print system */ > > printf("-------------------------------\n"); > printf("pthread_kill Latency\n"); > @@ -289,13 +283,6 @@ int main(int argc, char *argv[]) > > printf("Iterations: %d\n", ITERATIONS); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > debug(DBG_DEBUG, "Main creating threads\n"); > fflush(stdout); > > Index: ltp/testcases/realtime/func/sched_football/sched_football.c > =================================================================== > --- ltp.orig/testcases/realtime/func/sched_football/sched_football.c > +++ ltp/testcases/realtime/func/sched_football/sched_football.c > @@ -41,7 +41,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * John Stultz <johnstul@xxxxxxxxx > > @@ -66,7 +65,6 @@ > #include <unistd.h> > #include <sys/time.h> > #include <librttest.h> > -#include <libjvmsim.h> > > #define DEF_GAME_LENGTH 5 > > @@ -76,7 +74,6 @@ volatile int the_ball; > /* pthread_barrier for synchronization */ > pthread_barrier_t barrier; > > -static int run_jvmsim=0; > static int players_per_team = 0; > static int game_length = DEF_GAME_LENGTH; > > @@ -84,7 +81,6 @@ void usage(void) > { > rt_help(); > printf("sched_football specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -nPLAYERS players per team (defaults to num_cpus)\n"); > printf(" -lGAME_LENGTH game length in seconds (defaults to %d s)\n", > DEF_GAME_LENGTH); > @@ -95,9 +91,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -171,18 +164,11 @@ int main(int argc, char* argv[]) > int i; > setup(); > > - rt_init("n:l:jh",parse_args,argc,argv); > + rt_init("n:l:h",parse_args,argc,argv); > > if (players_per_team == 0) > players_per_team = sysconf(_SC_NPROCESSORS_ONLN); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > if ((i = pthread_barrier_init(&barrier, NULL, players_per_team*2 + 1))) { > printf("pthread_barrier_init failed: %s\n", strerror(i)); > exit(i); > Index: ltp/testcases/realtime/func/sched_jitter/sched_jitter.c > =================================================================== > --- ltp.orig/testcases/realtime/func/sched_jitter/sched_jitter.c > +++ ltp/testcases/realtime/func/sched_jitter/sched_jitter.c > @@ -31,7 +31,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * John Stultz <joh...@us...> > @@ -49,7 +48,6 @@ > #include <unistd.h> > #include <libstats.h> > #include <librttest.h> > -#include <libjvmsim.h> > > #define NUMRUNS 1000 > #define NUMLOOPS 1000000 > @@ -61,13 +59,11 @@ int array[WORKLEN]; > > volatile int flag; /*let interrupter know we're done */ > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("sched_jitter specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -75,9 +71,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -176,14 +169,7 @@ int main(int argc, char *argv[]) > > setup(); > > - rt_init("jh",parse_args,argc,argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("h",parse_args,argc,argv); > > interrupter = create_fifo_thread(thread_interrupter, NULL, 80); > sleep(1); > Index: ltp/testcases/realtime/func/sched_latency/sched_latency.c > =================================================================== > --- ltp.orig/testcases/realtime/func/sched_latency/sched_latency.c > +++ ltp/testcases/realtime/func/sched_latency/sched_latency.c > @@ -34,7 +34,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -51,7 +50,6 @@ > #include <math.h> > #include <librttest.h> > #include <libstats.h> > -#include <libjvmsim.h> > > #define PRIO 89 > //#define PERIOD 17*NS_PER_MS > @@ -66,7 +64,6 @@ > > nsec_t start; > nsec_t end; > -static int run_jvmsim = 0; > static int ret = 0; > static int iterations = 0; > static unsigned long long latency_threshold = 0; > @@ -81,7 +78,6 @@ void usage(void) > { > rt_help(); > printf("sched_latency specific options:\n"); > - printf(" -j enable jvmsim\n"); > printf(" -dLOAD periodic load in ms (default 1)\n"); > printf(" -lTHRESHOLD trace latency, with given threshold in us\n"); > printf(" -tPERIOD period in ms (default 5)\n"); > @@ -94,9 +90,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -235,7 +228,7 @@ int main(int argc, char *argv[]) > setup(); > > pass_criteria = PASS_US; > - rt_init("d:jl:ht:i:", parse_args, argc, argv); > + rt_init("d:l:ht:i:", parse_args, argc, argv); > > printf("-------------------------------\n"); > printf("Scheduling Latency\n"); > @@ -260,13 +253,6 @@ int main(int argc, char *argv[]) > printf("Expected running time: %d s\n", > (int)(iterations*((float)period / NS_PER_SEC))); > > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > - > if (stats_container_init(&dat, iterations)) > exit(1); > > Index: ltp/testcases/realtime/func/thread_clock/tc-2.c > =================================================================== > --- ltp.orig/testcases/realtime/func/thread_clock/tc-2.c > +++ ltp/testcases/realtime/func/thread_clock/tc-2.c > @@ -31,7 +31,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Sripathi Kodi <sri...@in...> > @@ -48,7 +47,6 @@ > #include <stdlib.h> > #include <unistd.h> > #include <librttest.h> > -#include <libjvmsim.h> > > #define NS_PER_SEC 1000000000 > #define THRESHOLD 0.5 /* 500 milliseconds */ > @@ -57,22 +55,17 @@ > > struct timespec sleepts[NUMSLEEP]; > struct timespec workts[NUMWORK]; > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("thread_clock specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > { > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -184,14 +177,7 @@ int main(int argc,char* argv[]) > setup(); > > pass_criteria = THRESHOLD; > - rt_init("jht:",parse_args,argc,argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("ht:",parse_args,argc,argv); > > /* Start sleeper threads */ > for (i=0; i<NUMSLEEP; i++) { > Index: ltp/testcases/realtime/perf/latency/pthread_cond_latency.c > =================================================================== > --- ltp.orig/testcases/realtime/perf/latency/pthread_cond_latency.c > +++ ltp/testcases/realtime/perf/latency/pthread_cond_latency.c > @@ -24,7 +24,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Paul E. McKenney <pa...@us...> > @@ -43,19 +42,16 @@ > #include <unistd.h> > #include <stdlib.h> > #include <librttest.h> > -#include <libjvmsim.h> > > pthread_mutex_t child_mutex = PTHREAD_MUTEX_INITIALIZER; > volatile int child_waiting = 0; > double endtime; > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("testpi-1 specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -63,9 +59,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -206,14 +199,7 @@ main(int argc, char *argv[]) > long iter; > setup(); > > - rt_init("jh", parse_args, argc, argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("h", parse_args, argc, argv); > > sp.sched_priority = sched_get_priority_max(SCHED_FIFO); > if (sp.sched_priority == -1) { > Index: ltp/testcases/realtime/stress/pi-tests/lookup_pi_state.c > =================================================================== > --- ltp.orig/testcases/realtime/stress/pi-tests/lookup_pi_state.c > +++ ltp/testcases/realtime/stress/pi-tests/lookup_pi_state.c > @@ -24,7 +24,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * Darren Hart <dv...@us...> > @@ -36,12 +35,10 @@ > > #include <stdio.h> > #include <librttest.h> > -#include <libjvmsim.h> > > #define NUM_SLAVES 20 > #define SLAVE_PRIO 89 > > -int enable_jvmsim = 0; > > pthread_mutex_t MM; > pthread_mutex_t MS; > @@ -54,13 +51,11 @@ atomic_t slave_order_a = {0}; > atomic_t slave_order_b = {0}; > atomic_t slave_order_c = {0}; > > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("lookup_pi_state specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -68,9 +63,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -180,15 +172,7 @@ int main(int argc, char *argv[]) > pthread_cond_init(&CS, NULL); > pthread_cond_init(&CT, NULL); > > - rt_init("jh", parse_args, argc, argv); > - > - // -j to enable jvmsim > - if (run_jvmsim) { > - printf("jvmsim Enabled\n"); > - jvmsim_init(); > - } else { > - printf("jvmsim disabled \n"); > - } > + rt_init("h", parse_args, argc, argv); > > create_other_thread(master_thread, (void *)0); > > Index: ltp/testcases/realtime/stress/pi-tests/testpi-3.c > =================================================================== > --- ltp.orig/testcases/realtime/stress/pi-tests/testpi-3.c > +++ ltp/testcases/realtime/stress/pi-tests/testpi-3.c > @@ -24,7 +24,6 @@ > * > * USAGE: > * Use run_auto.sh script in current directory to build and run test. > - * Use "-j" to enable jvm simulator. > * > * AUTHOR > * > @@ -43,15 +42,11 @@ > #include <sys/syscall.h> > #include <unistd.h> > #include <librttest.h> > -#include <libjvmsim.h> > - > -static int run_jvmsim=0; > > void usage(void) > { > rt_help(); > printf("testpi-3 specific options:\n"); > - printf(" -j enable jvmsim\n"); > } > > int parse_args(int c, char *v) > @@ -59,9 +54,6 @@ int parse_args(int c, char *v) > > int handled = 1; > switch (c) { > - case 'j': > - run_jvmsim = 1; > - break; > case 'h': > usage(); > exit(0); > @@ -322,14 +314,7 @@ int main(int argc, char* argv[]) { > CPU_SET(0, &mask); > setup(); > > - rt_init("jh",parse_args,argc,argv); > - > - if (run_jvmsim) { > - printf("jvmsim enabled\n"); > - jvmsim_init(); // Start the JVM simulation > - } else { > - printf("jvmsim disabled\n"); > - } > + rt_init("h",parse_args,argc,argv); > > retc = sched_setaffinity(0, sizeof(mask), &mask); > if (retc < 0) { > |
From: Chirag J. <ch...@li...> - 2008-11-26 05:10:27
|
This patch removes the libjvmsim itself. Hence no testcase can use it anymore Signed-Off-By: Chirag <ch...@li...> Acked-By: Sripathi Kodi <sri...@in...> ltp/testcases/realtime/config.mk | 7 testcases/realtime/include/libjvmsim.h | 70 ----- testcases/realtime/lib/libjvmsim.c | 410 --------------------------------- 3 files changed, 3 insertions(+), 484 deletions(-) Index: ltp/testcases/realtime/include/libjvmsim.h =================================================================== --- ltp.orig/testcases/realtime/include/libjvmsim.h +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** - * - * Copyright © International Business Machines Corp., 2006, 2008 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * NAME - * libjvmsim.h - * - * DESCRIPTION - * Provide threads to mimic real-time jvm activity - * - * Note: this "library" is written as a single header file to simplify the - * creation of new test cases and keep the build system simple. At some - * point it may make sense to break it up into .h and .c files and link to - * it as an object file. - * - * USAGE: - * To be included in testcases. - * - * AUTHOR - * Darren Hart <dv...@us...> - * - * HISTORY - * 2006-May-9: Initial version by Darren Hart - * - *****************************************************************************/ - -#ifndef LIBJVMSIM_H -#define LIBJVMSIM_H - -#define SIT_AND_WAIT \ -struct thread *t = (struct thread *)arg; \ -int i = 0; \ -while (!thread_quit(t)) { \ - pthread_mutex_lock(&block_mutex); \ - pthread_cond_wait(&block_cond, &block_mutex); \ - busy_work_us(50); /* this should only happen on exit atm */ \ - pthread_mutex_unlock(&block_mutex); \ - i++; \ -} \ -debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); \ -return NULL; - -/* Function Prototypes */ -void *jvm_gc_alarm(void *arg); -void *jvm_gc_collect(void *arg); -void *jvm_gc_trace(void *arg); -void *jvm_gc_finalize(void *arg); -void *jvm_posix_signal_dispatch(void *arg); -void *jvm_sigquit(void *arg); -void *jvm_async_event_server(void *arg); -void *jvm_timer_dispatch(void *arg); -void *jvm_ras_trace(void *arg); -void *jvmsim_monitor(void *arg); -void jvmsim_init(); - -#endif /* LIBJVMSIM_H */ Index: ltp/testcases/realtime/lib/libjvmsim.c =================================================================== --- ltp.orig/testcases/realtime/lib/libjvmsim.c +++ /dev/null @@ -1,410 +0,0 @@ -/****************************************************************************** - * - * Copyright © International Business Machines Corp., 2006, 2008 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * NAME - * libjvmsim.c - * - * DESCRIPTION - * Provide threads to mimic real-time jvm activity - * - * Note: this "library" is written as a single header file to simplify the - * creation of new test cases and keep the build system simple. At some - * point it may make sense to break it up into .h and .c files and link to - * it as an object file. - - * USAGE: - * To be included in testcases. - * - * AUTHOR - * Darren Hart <dv...@us...> - * - * HISTORY - * 2006-May-9: Initial version by Darren Hart - * - *****************************************************************************/ - -#include <stdio.h> -#include <sys/resource.h> -#include <sys/time.h> -#include <semaphore.h> -#include <librttest.h> - -/* this mutex and cond pair are used by the gc alarm and collect threads */ -static pthread_mutex_t gc_mutex = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t gc_cond; - -/* this semaphore is used by posix signal dispatch, and any other simulated - * by a sit and wait routine on a POSIX semaphore */ -sem_t block_sem; - -/* this mutex and cond pair are used by all threads simulated by a - * sit and wait routine on a pthread mutex and cond pair */ -static pthread_mutex_t block_mutex = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t block_cond; -#define SIT_AND_WAIT \ -struct thread *t = (struct thread *)arg; \ -int i = 0; \ -int ret; \ -nsec_t timeout; \ -struct timespec ts_timeout; \ -while (!thread_quit(t)) { \ - timeout = rt_gettime() + 50 * NS_PER_MS; \ - nsec_to_ts(timeout, &ts_timeout); \ - pthread_mutex_lock(&block_mutex); \ - ret = pthread_cond_timedwait(&block_cond, &block_mutex, &ts_timeout); \ - if (ret && ret != ETIMEDOUT) \ - printf("%s: %s\n", __FUNCTION__, strerror(ret)); \ - busy_work_us(50); /* this should only happen on exit atm */ \ - pthread_mutex_unlock(&block_mutex); \ - i++; \ -} \ -debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); \ -return NULL; - -/* High level description of JVM threads - * There may be other threads used for profiling, debug and trace - * purposes depending on options and application. - */ - -/* Main/Primordial  thread  (SCHED_OTHER prio) - * o Creates other internal threads and runs user's main(). - * o Typically would create the initial RT thread but otherwise - * is effectively in a pthread_cond wait state doing no work - * o Covered by testcase main() really (Not implemented here) - */ - -/* GC Alarm  (RT FIFO 89) - * o Does clock_nanosleep for 451us - * o Upon awakening, does a pthread_mutex_lock(m) and then a - * pthread_cond_signal(s) to a GC collect thread waiting on signal(s) - * o Repeat this process - */ -void *jvm_gc_alarm(void *arg) -{ - struct thread *t = (struct thread *)arg; - int i = 0; - while (!thread_quit(t)) { - rt_nanosleep(451*NS_PER_US); - pthread_mutex_lock(&gc_mutex); - pthread_cond_signal(&gc_cond); - pthread_mutex_unlock(&gc_mutex); - i++; - } - /* do it once more to make sure the collect thread can exit */ - pthread_mutex_lock(&gc_mutex); - pthread_cond_signal(&gc_cond); - pthread_mutex_unlock(&gc_mutex); - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); - return NULL; -} - -/* GC Collect (RT FIFO appPrio+1) - * o The default should be to have one such thread. There is a JVM option that - * can control the number of such worker threads created but the common case - * we should only have one running. - * o Does a pthread_cond_wait(m,s) - * o On pthread_cond_signal() from the alarm thread sees if there is GC work to - * be performed (small/trivial calculation - i.e. noise) - * o If no work, then the server thread repeats this whole process - * Performs gc work (which I don't think you would want to emulate) - * o Repeats this process - */ -void *jvm_gc_collect(void *arg) -{ - struct thread *t = (struct thread *)arg; - int i = 0; - int ret; - nsec_t timeout; - struct timespec ts_timeout; - - while (!thread_quit(t)) { - timeout = rt_gettime() + 50 * NS_PER_MS; - nsec_to_ts(timeout, &ts_timeout); - pthread_mutex_lock(&gc_mutex); - ret = pthread_cond_timedwait(&gc_cond, &gc_mutex, &ts_timeout); - if (ret && ret != ETIMEDOUT) - printf("%s: %s\n", __FUNCTION__, strerror(ret)); - busy_work_us(50); - pthread_mutex_unlock(&gc_mutex); - i++; - } - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); - return NULL; -} - -/* GC Trace Thread (SCHED_OTHER) - * o A thread that sleeps using pthread_cond_timedwait for 50 millis. - * o It wakes up, releases the  mutex does a getrusage(RUSAGE_SELF, ×) - * call and some small calculations (~50us or so) then goes back to the - * timewait (grabbing mutex of course) - */ -void *jvm_gc_trace(void *arg) -{ - struct thread *t = (struct thread *)arg; - pthread_cond_t c; - pthread_condattr_t c_attr; - pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; - nsec_t abs_timeout; - struct timespec ts_timeout; - struct rusage usage; - int i, ret; - - /* use the same clock as the timeout value */ - pthread_condattr_init(&c_attr); - if (pthread_condattr_setclock(&c_attr, CLOCK_MONOTONIC) != 0) { - perror("pthread_condattr_setclock"); - exit(-1); - } - if (pthread_cond_init(&c, &c_attr) != 0) { - perror("pthread_cond_init"); - exit(-1); - } - - i=0; - while (!thread_quit(t)) { - pthread_mutex_lock(&m); - abs_timeout = rt_gettime() + 50 * NS_PER_MS; - nsec_to_ts(abs_timeout, &ts_timeout); - do { - ret = pthread_cond_timedwait(&c, &m, &ts_timeout); - } while (ret == 0); - if (ret != ETIMEDOUT) - printf("%s: %s\n", __FUNCTION__, strerror(ret)); - getrusage(RUSAGE_SELF, &usage); - busy_work_us(50); - pthread_mutex_unlock(&m); - i++; - } - pthread_condattr_destroy(&c_attr); - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); - return NULL; -} - -/* GC Finalize (SCHED_OTHER) - * o GC could dispatch work off to this thread depending on users - * application. But, for the common case I believe this thread should be - * in a wait state and can be ignored, - */ -/* sit and wait */ -void *jvm_gc_finalize(void *arg) -{ -SIT_AND_WAIT -} - -/* GC Processor info thread (RT FIFO ??) - * o JVM startup creates one such thread per processor and binds one - * thread per the individual processors (including CPU 0). Each threads - * tries to calculate its CPU frequency,  and when done,  the thread dies. - * o For the common case, these threads have exited and so are not running. - * I do have comeback as to how long they run to perform the frequency - * calculation. (will append that later) - */ -/* can ignore this one */ -/*void *jvm_gc_cpu_info(void *arg) -{ - //struct thread *t = (struct thread *)arg; -}*/ - -/* POSIX Signal Dispatch (RT FIFO 87) - * o should be in a sem_wait() state. Async signals such as SIGABORT, SIGQUIT, - * SIGSTOP are delegated off to this thread from a signal handler using - * sem_post(). - * o For the common case, this thread should be in a sem_wait() state and so - * doing nothing. I.E. can be ignored. - */ -/* good to have, sit and do nothing */ -void *jvm_posix_signal_dispatch(void *arg) -{ - struct thread *t = (struct thread *)arg; - int i = 0; - nsec_t timeout; - struct timespec ts_timeout; - - while (!thread_quit(t)) { - clock_gettime(CLOCK_REALTIME, &ts_timeout); - ts_to_nsec(&ts_timeout, &timeout); - timeout += 50 * NS_PER_MS; - nsec_to_ts(timeout, &ts_timeout); - sem_timedwait(&block_sem, &ts_timeout); - i++; - } - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); - return NULL; -} - -/* POSIX Signal Dispatch NH - * o This thread is analogous to the previous thread. The reason we have 2 is - * that the former thread may touch the heap while this thread cannot. - * I.E. can be ignored. - */ -/*void *jvm_posix_signal_dispatch_nh(void *arg) -{ - //struct thread *t = (struct thread *)arg; -}*/ - -/* JIT Sampler (RT FIFO 1) - * o Somewhat like the alarm thread and used by JIT. - * o For configuration running AOT this thread is not running and can be - * ignored - */ -/* not needed with aot */ -/*void *jvm_jit_sampler(void *arg) -{ - //struct thread *t = (struct thread *)arg; -}*/ - -/* JIT Compile (should be SCHED_OTHER - but think it is not) - * o Does a JIT compile. - * o For Configurations running AOT this thread is not running and can - * be ignored - */ -/* not needed with aot */ -/*void *jvm_jit_compile(void *arg) -{ - //struct thread *t = (struct thread *)arg; -}*/ - -/* SigQuit Thread (SCHED_OTHER but the priority will likely be raised) - * o SIGQUIT helper thread. The thread is in a pthread_cond_wait() so, - * for our purposes, should not be doing any work. - */ -/* good to have - sit there and do nothing until exit*/ -void *jvm_sigquit(void *arg) -{ -SIT_AND_WAIT -} - -/* Async EventServerThreads (priority described below) - * o A pool of threads that are used to service hander fire requests and bind - * to handler. - * o 6  or so threads are created in a wait state at priority 83 (I believe). - * The priority of these theads is changed to the appropriate RT priority - * before they exit the wait state and they go back to prio 83 when they are - * done servicing the request. - * o For the common case, these threads should just be waiting. - */ -void *jvm_async_event_server(void *arg) -{ -SIT_AND_WAIT -} - -/* Async EventServerThreads NH - * o Same as previous (# threads may be different) but used for handlers that - * can't access the Java heap. - */ -/*void *jvm_async_event_server_nh(void *arg) -{ - //struct thread *t = (struct thread *)arg; -}*/ - -/* Timer Dispatch (RT FIFO 83 currently) - * o A thread used as part of implementation for Timers that need to fire at - * certain times. - * o In a wait state if no timers or handlers are created (default) - */ -void *jvm_timer_dispatch(void *arg) -{ -SIT_AND_WAIT -} - -/* Timer Dispatch NH - * o same as previous except for threads that cannot access the Java heap. - */ -/*void *jvm_timer_dispatch_nh(void *arg) -{ - //struct thread *t = (struct thread *)arg; -}*/ - -/* RAS trace thread (SCHED_OTHER) - * o in support of some JVM tracing activities - * o is in a wait state - */ -void *jvm_ras_trace(void *arg) -{ -SIT_AND_WAIT -} - -/* cleanup and wakeup blocked threads at join_threads() time */ -void *jvmsim_monitor(void *arg) { - struct thread *t = (struct thread *)arg; - int i = 0; - - while (!thread_quit(t)) { - usleep(10*US_PER_MS); - i++; - } - - /* unblock all the sit and wait threads */ - pthread_mutex_lock(&block_mutex); - pthread_cond_broadcast(&block_cond); - pthread_mutex_unlock(&block_mutex); - - sem_post(&block_sem); /* allow jvm_posix_signal_dispatch() to exit */ - - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); - return NULL; -} - -/* FIXME: the priorities used below will need to be adjusted - * and librt.h should be made to provide access to the highest - * prio running thread - perhaps with a listener interface... (so the gc - * can be boosted to app+1 prio. - */ - -/* convenience functions for starting groups of jvm simulation threads */ -void jvmsim_init(void) -{ - pthread_condattr_t c_attr; - sem_init(&block_sem, 0, 0); - - if (pthread_condattr_setclock(&c_attr, CLOCK_MONOTONIC) != 0) { - perror("pthread_condattr_setclock"); - exit(-1); - } - if (pthread_cond_init(&gc_cond, &c_attr) != 0) { - perror("pthread_cond_init"); - exit(-1); - } - if (pthread_cond_init(&block_cond, &c_attr) != 0) { - perror("pthread_cond_init"); - exit(-1); - } - - create_other_thread(jvmsim_monitor, (void *)0); - create_fifo_thread(jvm_gc_alarm, (void *)0, 89); - /* The gc collect thread varies - this can be modelled better */ - create_fifo_thread(jvm_gc_collect, (void *)0, 82); - create_other_thread(jvm_gc_trace, (void *)12); - create_other_thread(jvm_gc_finalize, (void *)0); - create_fifo_thread(jvm_posix_signal_dispatch, (void *)0, 87); - create_other_thread(jvm_sigquit, (void *)88); - create_fifo_thread(jvm_async_event_server, (void *)0, 85); - create_fifo_thread(jvm_async_event_server, (void *)0, 85); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_async_event_server, (void *)0, 83); - create_fifo_thread(jvm_timer_dispatch, (void *)0, 85); - create_fifo_thread(jvm_timer_dispatch, (void *)0, 83); - create_other_thread(jvm_ras_trace, (void *)0); -} - Index: ltp/testcases/realtime/config.mk =================================================================== --- ltp.orig/testcases/realtime/config.mk +++ ltp/testcases/realtime/config.mk @@ -18,8 +18,7 @@ endif # CPPFLAGS += -I$(srcdir)/include -D_GNU_SOURCE CFLAGS += -Wall -LDLIBS += $(srcdir)/lib/libjvmsim.o \ - $(srcdir)/lib/librttest.o \ - $(srcdir)/lib/libstats.o \ - -lpthread -lrt -lm +LDLIBS += $(srcdir)/lib/librttest.o \ + $(srcdir)/lib/libstats.o \ + -lpthread -lrt -lm -- -Thanks,Chirag |
From: Subrata M. <su...@li...> - 2008-11-28 10:43:07
|
On Wed, 2008-11-26 at 10:40 +0530, Chirag Jog wrote: > This patch removes the libjvmsim itself. Hence no > testcase can use it anymore > > Signed-Off-By: Chirag <ch...@li...> > Acked-By: Sripathi Kodi <sri...@in...> Thanks for this too. Regards-- Subrata > > > > ltp/testcases/realtime/config.mk | 7 > testcases/realtime/include/libjvmsim.h | 70 ----- > testcases/realtime/lib/libjvmsim.c | 410 --------------------------------- > 3 files changed, 3 insertions(+), 484 deletions(-) > > Index: ltp/testcases/realtime/include/libjvmsim.h > =================================================================== > --- ltp.orig/testcases/realtime/include/libjvmsim.h > +++ /dev/null > @@ -1,70 +0,0 @@ > -/****************************************************************************** > - * > - * Copyright © International Business Machines Corp., 2006, 2008 > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation; either version 2 of the License, or > - * (at your option) any later version. > - * > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > - * the GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License > - * along with this program; if not, write to the Free Software > - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > - * > - * NAME > - * libjvmsim.h > - * > - * DESCRIPTION > - * Provide threads to mimic real-time jvm activity > - * > - * Note: this "library" is written as a single header file to simplify the > - * creation of new test cases and keep the build system simple. At some > - * point it may make sense to break it up into .h and .c files and link to > - * it as an object file. > - * > - * USAGE: > - * To be included in testcases. > - * > - * AUTHOR > - * Darren Hart <dv...@us...> > - * > - * HISTORY > - * 2006-May-9: Initial version by Darren Hart > - * > - *****************************************************************************/ > - > -#ifndef LIBJVMSIM_H > -#define LIBJVMSIM_H > - > -#define SIT_AND_WAIT \ > -struct thread *t = (struct thread *)arg; \ > -int i = 0; \ > -while (!thread_quit(t)) { \ > - pthread_mutex_lock(&block_mutex); \ > - pthread_cond_wait(&block_cond, &block_mutex); \ > - busy_work_us(50); /* this should only happen on exit atm */ \ > - pthread_mutex_unlock(&block_mutex); \ > - i++; \ > -} \ > -debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); \ > -return NULL; > - > -/* Function Prototypes */ > -void *jvm_gc_alarm(void *arg); > -void *jvm_gc_collect(void *arg); > -void *jvm_gc_trace(void *arg); > -void *jvm_gc_finalize(void *arg); > -void *jvm_posix_signal_dispatch(void *arg); > -void *jvm_sigquit(void *arg); > -void *jvm_async_event_server(void *arg); > -void *jvm_timer_dispatch(void *arg); > -void *jvm_ras_trace(void *arg); > -void *jvmsim_monitor(void *arg); > -void jvmsim_init(); > - > -#endif /* LIBJVMSIM_H */ > Index: ltp/testcases/realtime/lib/libjvmsim.c > =================================================================== > --- ltp.orig/testcases/realtime/lib/libjvmsim.c > +++ /dev/null > @@ -1,410 +0,0 @@ > -/****************************************************************************** > - * > - * Copyright © International Business Machines Corp., 2006, 2008 > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation; either version 2 of the License, or > - * (at your option) any later version. > - * > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > - * the GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License > - * along with this program; if not, write to the Free Software > - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > - * > - * NAME > - * libjvmsim.c > - * > - * DESCRIPTION > - * Provide threads to mimic real-time jvm activity > - * > - * Note: this "library" is written as a single header file to simplify the > - * creation of new test cases and keep the build system simple. At some > - * point it may make sense to break it up into .h and .c files and link to > - * it as an object file. > - > - * USAGE: > - * To be included in testcases. > - * > - * AUTHOR > - * Darren Hart <dv...@us...> > - * > - * HISTORY > - * 2006-May-9: Initial version by Darren Hart > - * > - *****************************************************************************/ > - > -#include <stdio.h> > -#include <sys/resource.h> > -#include <sys/time.h> > -#include <semaphore.h> > -#include <librttest.h> > - > -/* this mutex and cond pair are used by the gc alarm and collect threads */ > -static pthread_mutex_t gc_mutex = PTHREAD_MUTEX_INITIALIZER; > -static pthread_cond_t gc_cond; > - > -/* this semaphore is used by posix signal dispatch, and any other simulated > - * by a sit and wait routine on a POSIX semaphore */ > -sem_t block_sem; > - > -/* this mutex and cond pair are used by all threads simulated by a > - * sit and wait routine on a pthread mutex and cond pair */ > -static pthread_mutex_t block_mutex = PTHREAD_MUTEX_INITIALIZER; > -static pthread_cond_t block_cond; > -#define SIT_AND_WAIT \ > -struct thread *t = (struct thread *)arg; \ > -int i = 0; \ > -int ret; \ > -nsec_t timeout; \ > -struct timespec ts_timeout; \ > -while (!thread_quit(t)) { \ > - timeout = rt_gettime() + 50 * NS_PER_MS; \ > - nsec_to_ts(timeout, &ts_timeout); \ > - pthread_mutex_lock(&block_mutex); \ > - ret = pthread_cond_timedwait(&block_cond, &block_mutex, &ts_timeout); \ > - if (ret && ret != ETIMEDOUT) \ > - printf("%s: %s\n", __FUNCTION__, strerror(ret)); \ > - busy_work_us(50); /* this should only happen on exit atm */ \ > - pthread_mutex_unlock(&block_mutex); \ > - i++; \ > -} \ > -debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); \ > -return NULL; > - > -/* High level description of JVM threads > - * There may be other threads used for profiling, debug and trace > - * purposes depending on options and application. > - */ > - > -/* Main/Primordial  thread  (SCHED_OTHER prio) > - * o Creates other internal threads and runs user's main(). > - * o Typically would create the initial RT thread but otherwise > - * is effectively in a pthread_cond wait state doing no work > - * o Covered by testcase main() really (Not implemented here) > - */ > - > -/* GC Alarm  (RT FIFO 89) > - * o Does clock_nanosleep for 451us > - * o Upon awakening, does a pthread_mutex_lock(m) and then a > - * pthread_cond_signal(s) to a GC collect thread waiting on signal(s) > - * o Repeat this process > - */ > -void *jvm_gc_alarm(void *arg) > -{ > - struct thread *t = (struct thread *)arg; > - int i = 0; > - while (!thread_quit(t)) { > - rt_nanosleep(451*NS_PER_US); > - pthread_mutex_lock(&gc_mutex); > - pthread_cond_signal(&gc_cond); > - pthread_mutex_unlock(&gc_mutex); > - i++; > - } > - /* do it once more to make sure the collect thread can exit */ > - pthread_mutex_lock(&gc_mutex); > - pthread_cond_signal(&gc_cond); > - pthread_mutex_unlock(&gc_mutex); > - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); > - return NULL; > -} > - > -/* GC Collect (RT FIFO appPrio+1) > - * o The default should be to have one such thread. There is a JVM option that > - * can control the number of such worker threads created but the common case > - * we should only have one running. > - * o Does a pthread_cond_wait(m,s) > - * o On pthread_cond_signal() from the alarm thread sees if there is GC work to > - * be performed (small/trivial calculation - i.e. noise) > - * o If no work, then the server thread repeats this whole process > - * Performs gc work (which I don't think you would want to emulate) > - * o Repeats this process > - */ > -void *jvm_gc_collect(void *arg) > -{ > - struct thread *t = (struct thread *)arg; > - int i = 0; > - int ret; > - nsec_t timeout; > - struct timespec ts_timeout; > - > - while (!thread_quit(t)) { > - timeout = rt_gettime() + 50 * NS_PER_MS; > - nsec_to_ts(timeout, &ts_timeout); > - pthread_mutex_lock(&gc_mutex); > - ret = pthread_cond_timedwait(&gc_cond, &gc_mutex, &ts_timeout); > - if (ret && ret != ETIMEDOUT) > - printf("%s: %s\n", __FUNCTION__, strerror(ret)); > - busy_work_us(50); > - pthread_mutex_unlock(&gc_mutex); > - i++; > - } > - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); > - return NULL; > -} > - > -/* GC Trace Thread (SCHED_OTHER) > - * o A thread that sleeps using pthread_cond_timedwait for 50 millis. > - * o It wakes up, releases the  mutex does a getrusage(RUSAGE_SELF, ×) > - * call and some small calculations (~50us or so) then goes back to the > - * timewait (grabbing mutex of course) > - */ > -void *jvm_gc_trace(void *arg) > -{ > - struct thread *t = (struct thread *)arg; > - pthread_cond_t c; > - pthread_condattr_t c_attr; > - pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; > - nsec_t abs_timeout; > - struct timespec ts_timeout; > - struct rusage usage; > - int i, ret; > - > - /* use the same clock as the timeout value */ > - pthread_condattr_init(&c_attr); > - if (pthread_condattr_setclock(&c_attr, CLOCK_MONOTONIC) != 0) { > - perror("pthread_condattr_setclock"); > - exit(-1); > - } > - if (pthread_cond_init(&c, &c_attr) != 0) { > - perror("pthread_cond_init"); > - exit(-1); > - } > - > - i=0; > - while (!thread_quit(t)) { > - pthread_mutex_lock(&m); > - abs_timeout = rt_gettime() + 50 * NS_PER_MS; > - nsec_to_ts(abs_timeout, &ts_timeout); > - do { > - ret = pthread_cond_timedwait(&c, &m, &ts_timeout); > - } while (ret == 0); > - if (ret != ETIMEDOUT) > - printf("%s: %s\n", __FUNCTION__, strerror(ret)); > - getrusage(RUSAGE_SELF, &usage); > - busy_work_us(50); > - pthread_mutex_unlock(&m); > - i++; > - } > - pthread_condattr_destroy(&c_attr); > - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); > - return NULL; > -} > - > -/* GC Finalize (SCHED_OTHER) > - * o GC could dispatch work off to this thread depending on users > - * application. But, for the common case I believe this thread should be > - * in a wait state and can be ignored, > - */ > -/* sit and wait */ > -void *jvm_gc_finalize(void *arg) > -{ > -SIT_AND_WAIT > -} > - > -/* GC Processor info thread (RT FIFO ??) > - * o JVM startup creates one such thread per processor and binds one > - * thread per the individual processors (including CPU 0). Each threads > - * tries to calculate its CPU frequency,  and when done,  the thread dies. > - * o For the common case, these threads have exited and so are not running. > - * I do have comeback as to how long they run to perform the frequency > - * calculation. (will append that later) > - */ > -/* can ignore this one */ > -/*void *jvm_gc_cpu_info(void *arg) > -{ > - //struct thread *t = (struct thread *)arg; > -}*/ > - > -/* POSIX Signal Dispatch (RT FIFO 87) > - * o should be in a sem_wait() state. Async signals such as SIGABORT, SIGQUIT, > - * SIGSTOP are delegated off to this thread from a signal handler using > - * sem_post(). > - * o For the common case, this thread should be in a sem_wait() state and so > - * doing nothing. I.E. can be ignored. > - */ > -/* good to have, sit and do nothing */ > -void *jvm_posix_signal_dispatch(void *arg) > -{ > - struct thread *t = (struct thread *)arg; > - int i = 0; > - nsec_t timeout; > - struct timespec ts_timeout; > - > - while (!thread_quit(t)) { > - clock_gettime(CLOCK_REALTIME, &ts_timeout); > - ts_to_nsec(&ts_timeout, &timeout); > - timeout += 50 * NS_PER_MS; > - nsec_to_ts(timeout, &ts_timeout); > - sem_timedwait(&block_sem, &ts_timeout); > - i++; > - } > - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); > - return NULL; > -} > - > -/* POSIX Signal Dispatch NH > - * o This thread is analogous to the previous thread. The reason we have 2 is > - * that the former thread may touch the heap while this thread cannot. > - * I.E. can be ignored. > - */ > -/*void *jvm_posix_signal_dispatch_nh(void *arg) > -{ > - //struct thread *t = (struct thread *)arg; > -}*/ > - > -/* JIT Sampler (RT FIFO 1) > - * o Somewhat like the alarm thread and used by JIT. > - * o For configuration running AOT this thread is not running and can be > - * ignored > - */ > -/* not needed with aot */ > -/*void *jvm_jit_sampler(void *arg) > -{ > - //struct thread *t = (struct thread *)arg; > -}*/ > - > -/* JIT Compile (should be SCHED_OTHER - but think it is not) > - * o Does a JIT compile. > - * o For Configurations running AOT this thread is not running and can > - * be ignored > - */ > -/* not needed with aot */ > -/*void *jvm_jit_compile(void *arg) > -{ > - //struct thread *t = (struct thread *)arg; > -}*/ > - > -/* SigQuit Thread (SCHED_OTHER but the priority will likely be raised) > - * o SIGQUIT helper thread. The thread is in a pthread_cond_wait() so, > - * for our purposes, should not be doing any work. > - */ > -/* good to have - sit there and do nothing until exit*/ > -void *jvm_sigquit(void *arg) > -{ > -SIT_AND_WAIT > -} > - > -/* Async EventServerThreads (priority described below) > - * o A pool of threads that are used to service hander fire requests and bind > - * to handler. > - * o 6  or so threads are created in a wait state at priority 83 (I believe). > - * The priority of these theads is changed to the appropriate RT priority > - * before they exit the wait state and they go back to prio 83 when they are > - * done servicing the request. > - * o For the common case, these threads should just be waiting. > - */ > -void *jvm_async_event_server(void *arg) > -{ > -SIT_AND_WAIT > -} > - > -/* Async EventServerThreads NH > - * o Same as previous (# threads may be different) but used for handlers that > - * can't access the Java heap. > - */ > -/*void *jvm_async_event_server_nh(void *arg) > -{ > - //struct thread *t = (struct thread *)arg; > -}*/ > - > -/* Timer Dispatch (RT FIFO 83 currently) > - * o A thread used as part of implementation for Timers that need to fire at > - * certain times. > - * o In a wait state if no timers or handlers are created (default) > - */ > -void *jvm_timer_dispatch(void *arg) > -{ > -SIT_AND_WAIT > -} > - > -/* Timer Dispatch NH > - * o same as previous except for threads that cannot access the Java heap. > - */ > -/*void *jvm_timer_dispatch_nh(void *arg) > -{ > - //struct thread *t = (struct thread *)arg; > -}*/ > - > -/* RAS trace thread (SCHED_OTHER) > - * o in support of some JVM tracing activities > - * o is in a wait state > - */ > -void *jvm_ras_trace(void *arg) > -{ > -SIT_AND_WAIT > -} > - > -/* cleanup and wakeup blocked threads at join_threads() time */ > -void *jvmsim_monitor(void *arg) { > - struct thread *t = (struct thread *)arg; > - int i = 0; > - > - while (!thread_quit(t)) { > - usleep(10*US_PER_MS); > - i++; > - } > - > - /* unblock all the sit and wait threads */ > - pthread_mutex_lock(&block_mutex); > - pthread_cond_broadcast(&block_cond); > - pthread_mutex_unlock(&block_mutex); > - > - sem_post(&block_sem); /* allow jvm_posix_signal_dispatch() to exit */ > - > - debug(DBG_INFO, "JVMSIM: %s thread woke %d times\n", __FUNCTION__, i); > - return NULL; > -} > - > -/* FIXME: the priorities used below will need to be adjusted > - * and librt.h should be made to provide access to the highest > - * prio running thread - perhaps with a listener interface... (so the gc > - * can be boosted to app+1 prio. > - */ > - > -/* convenience functions for starting groups of jvm simulation threads */ > -void jvmsim_init(void) > -{ > - pthread_condattr_t c_attr; > - sem_init(&block_sem, 0, 0); > - > - if (pthread_condattr_setclock(&c_attr, CLOCK_MONOTONIC) != 0) { > - perror("pthread_condattr_setclock"); > - exit(-1); > - } > - if (pthread_cond_init(&gc_cond, &c_attr) != 0) { > - perror("pthread_cond_init"); > - exit(-1); > - } > - if (pthread_cond_init(&block_cond, &c_attr) != 0) { > - perror("pthread_cond_init"); > - exit(-1); > - } > - > - create_other_thread(jvmsim_monitor, (void *)0); > - create_fifo_thread(jvm_gc_alarm, (void *)0, 89); > - /* The gc collect thread varies - this can be modelled better */ > - create_fifo_thread(jvm_gc_collect, (void *)0, 82); > - create_other_thread(jvm_gc_trace, (void *)12); > - create_other_thread(jvm_gc_finalize, (void *)0); > - create_fifo_thread(jvm_posix_signal_dispatch, (void *)0, 87); > - create_other_thread(jvm_sigquit, (void *)88); > - create_fifo_thread(jvm_async_event_server, (void *)0, 85); > - create_fifo_thread(jvm_async_event_server, (void *)0, 85); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_async_event_server, (void *)0, 83); > - create_fifo_thread(jvm_timer_dispatch, (void *)0, 85); > - create_fifo_thread(jvm_timer_dispatch, (void *)0, 83); > - create_other_thread(jvm_ras_trace, (void *)0); > -} > - > Index: ltp/testcases/realtime/config.mk > =================================================================== > --- ltp.orig/testcases/realtime/config.mk > +++ ltp/testcases/realtime/config.mk > @@ -18,8 +18,7 @@ endif > # > CPPFLAGS += -I$(srcdir)/include -D_GNU_SOURCE > CFLAGS += -Wall > -LDLIBS += $(srcdir)/lib/libjvmsim.o \ > - $(srcdir)/lib/librttest.o \ > - $(srcdir)/lib/libstats.o \ > - -lpthread -lrt -lm > +LDLIBS += $(srcdir)/lib/librttest.o \ > + $(srcdir)/lib/libstats.o \ > + -lpthread -lrt -lm > |