projects
/
bluesky.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add scripts for automatically testing reads at different settings.
[bluesky.git]
/
microbench
/
readbench.c
diff --git
a/microbench/readbench.c
b/microbench/readbench.c
index
88eb888
..
84d6a82
100644
(file)
--- a/
microbench/readbench.c
+++ b/
microbench/readbench.c
@@
-55,7
+55,7
@@
void *benchmark_thread(void *arg)
struct thread_state *ts = (struct thread_state *)arg;
char namebuf[64];
struct thread_state *ts = (struct thread_state *)arg;
char namebuf[64];
- sprintf(namebuf, "file-%d", ts->thread_num);
+ sprintf(namebuf, "file-%d", ts->thread_num
+ 1
);
printf("Opening %s\n", namebuf);
int64_t start, end;
printf("Opening %s\n", namebuf);
int64_t start, end;
@@
-96,11
+96,20
@@
void wait_thread(int n)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- for (int i = 0; i < 8; i++) {
+ int threads = 8;
+
+ if (argc > 1)
+ threads = atoi(argv[1]);
+ if (threads > MAX_THREADS)
+ threads = MAX_THREADS;
+
+ printf("Testing with %d threads\n", threads);
+
+ for (int i = 0; i < threads; i++) {
launch_thread(i);
}
launch_thread(i);
}
- for (int i = 0; i <
8
; i++) {
+ for (int i = 0; i <
threads
; i++) {
wait_thread(i);
}
wait_thread(i);
}