--- /dev/null
+#!/bin/sh
+
+#run all tests
+
+#set to number of active CPUS
+NUM_CPUS=8
+
+#extra options, e.g. for setting affinity on even CPUs :
+#EXTRA_OPTS=$(for a in $(seq 0 2 63); do echo -n "-a ${a} "; done)
+
+
+#Vary update fraction
+#x: vary update fraction from 0 to 0.0001
+ #fix number of readers and reader C.S. length, vary delay between updates
+#y: ops/s
+
+echo Executing update fraction test
+
+NR_READERS=$((${NUM_CPUS} - 1))
+NR_WRITERS=1
+DURATION=10
+WDELAY_ARRAY="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
+ 65536 131072 262144 524288 1048576 2097152"
+
+rm -f update-fraction.log
+
+for WDELAY in ${WDELAY_ARRAY}; do
+ ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} -d ${WDELAY} ${EXTRA_OPTS} | tee -a update-fraction.log
+done
+
+
+#Test scalability :
+# x: vary number of readers from 0 to num cpus
+# y: ops/s
+# 0 writer.
+
+echo Executing scalability test
+
+NR_WRITERS=0
+DURATION=10
+
+rm -f scalability.log
+
+for NR_READERS in $(seq 1 ${NUM_CPUS}); do
+ ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} ${EXTRA_OPTS}| tee -a scalability.log
+done
+
+
+# x: Vary reader C.S. length from 0 to 100 us
+# y: ops/s
+# 8 readers
+# 0 writers
+
+echo Executing reader C.S. length test
+
+NR_READERS=8
+NR_WRITERS=0
+DURATION=10
+#in loops.
+READERCSLEN_ARRAY="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768"
+
+rm -f readercslen.log
+
+for READERCSLEN in ${READERCSLEN_ARRAY}; do
+ ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} ${EXTRA_OPTS} -c ${READERCSLEN} | tee -a readercslen.log
+done
#!/bin/sh
-#add urcu mb
-
for a in test_urcu test_urcu_mb test_qsbr test_rwlock test_perthreadlock \
test_mutex; do
./${a} $*
done
-
-#Vary update fraction
-#x: vary update fraction from 0 to 0.0001
- #fix number of readers, vary delay between updates
-#y: ops/s
-
-echo Execution update fraction test
-
-
-#Test scalability :
-# x: vary number of readers from 0 to num cpus
-# y: ops/s
-# 0 writer.
-
-echo Executing scalability test
-
-# x: Vary reader C.S. length from 0 to 10us
-# y: ops/s
-# 8 readers
-# 0 writers
-
-echo Executing reader C.S. length test
-
-
-
-
static volatile int test_go, test_stop;
-static int wdelay;
+static unsigned long wdelay;
static volatile struct test_array test_array = { 8 };
if (unlikely(!test_duration_write()))
break;
if (unlikely(wdelay))
- usleep(wdelay);
+ loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
show_usage(argc, argv);
return -1;
}
- rduration = atoi(argv[++i]);
+ rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
return -1;
}
- wdelay = atoi(argv[++i]);
+ wdelay = atol(argv[++i]);
break;
case 'v':
verbose_mode = 1;
printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
- printf_verbose("Writer delay : %u us.\n", wdelay);
+ printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
tot_writes);
printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
"nr_writers %3u "
- "wdelay %4u nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
+ "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
argv[0], duration, nr_readers, rduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);
static volatile int test_go, test_stop;
-static int wdelay;
+static unsigned long wdelay;
static volatile struct test_array test_array = { 8 };
if (unlikely(!test_duration_write()))
break;
if (unlikely(wdelay))
- usleep(wdelay);
+ loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
show_usage(argc, argv);
return -1;
}
- rduration = atoi(argv[++i]);
+ rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
return -1;
}
- wdelay = atoi(argv[++i]);
+ wdelay = atol(argv[++i]);
break;
case 'v':
verbose_mode = 1;
printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
- printf_verbose("Writer delay : %u us.\n", wdelay);
+ printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
tot_writes);
printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
"nr_writers %3u "
- "wdelay %4u nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
+ "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
argv[0], duration, nr_readers, rduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);
static volatile int test_go, test_stop;
-static int wdelay;
+static unsigned long wdelay;
static struct test_array *test_rcu_pointer;
if (unlikely(!test_duration_write()))
break;
if (unlikely(wdelay))
- usleep(wdelay);
+ loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
show_usage(argc, argv);
return -1;
}
- rduration = atoi(argv[++i]);
+ rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
return -1;
}
- wdelay = atoi(argv[++i]);
+ wdelay = atol(argv[++i]);
break;
case 'v':
verbose_mode = 1;
printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
- printf_verbose("Writer delay : %u us.\n", wdelay);
+ printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
tot_writes);
printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
"nr_writers %3u "
- "wdelay %4u nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
+ "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
argv[0], duration, nr_readers, rduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);
static volatile int test_go, test_stop;
-static int wdelay;
+static unsigned long wdelay;
static volatile struct test_array test_array = { 8 };
if (unlikely(!test_duration_write()))
break;
if (unlikely(wdelay))
- usleep(wdelay);
+ loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
show_usage(argc, argv);
return -1;
}
- rduration = atoi(argv[++i]);
+ rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
return -1;
}
- wdelay = atoi(argv[++i]);
+ wdelay = atol(argv[++i]);
break;
case 'v':
verbose_mode = 1;
printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
- printf_verbose("Writer delay : %u us.\n", wdelay);
+ printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
tot_writes);
printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
"nr_writers %3u "
- "wdelay %4u nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
+ "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
argv[0], duration, nr_readers, rduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);
static volatile int test_go, test_stop;
-static int wdelay;
+static unsigned long wdelay;
static struct test_array *test_rcu_pointer;
if (unlikely(!test_duration_write()))
break;
if (unlikely(wdelay))
- usleep(wdelay);
+ loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
show_usage(argc, argv);
return -1;
}
- rduration = atoi(argv[++i]);
+ rduration = atol(argv[++i]);
break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
return -1;
}
- wdelay = atoi(argv[++i]);
+ wdelay = atol(argv[++i]);
break;
case 'v':
verbose_mode = 1;
printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
- printf_verbose("Writer delay : %u us.\n", wdelay);
+ printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
tot_writes);
printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
"nr_writers %3u "
- "wdelay %4u nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
+ "wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
argv[0], duration, nr_readers, rduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);