diff options
| author | william <[email protected]> | 2014-01-10 20:08:02 -0800 |
|---|---|---|
| committer | william <[email protected]> | 2014-01-10 20:10:16 -0800 |
| commit | efd656d633b2ff10f12e5559ca5d342804714ba5 (patch) | |
| tree | 2dae90f9c3f01700d5ac780ea72f4b0c1067a792 | |
| parent | c06dcf952876a93bd5ac9e03d49ea5027fe95046 (diff) | |
pass along verboseness setting to benchmark implementations
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | bench-heap.c | 2 | ||||
| -rw-r--r-- | bench-wheel.c | 6 | ||||
| -rw-r--r-- | bench.c | 2 | ||||
| -rw-r--r-- | bench.h | 2 |
5 files changed, 9 insertions, 5 deletions
@@ -4,7 +4,7 @@ WHEEL_BIT = 6 WHEEL_NUM = 4 CPPFLAGS = -DTIMEOUT_DEBUG -CFLAGS = -O2 -g -Wall -Wextra +CFLAGS = -O2 -g -Wall -Wextra -Wno-unused-parameter timeout: CPPFLAGS+=-DWHEEL_BIT=$(WHEEL_BIT) -DWHEEL_NUM=$(WHEEL_NUM) diff --git a/bench-heap.c b/bench-heap.c index e132380..46a522b 100644 --- a/bench-heap.c +++ b/bench-heap.c @@ -158,7 +158,7 @@ void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct timeout* e) static timeout_t curtime; static min_heap_t timeouts; -static void init(struct timeout *timeout, size_t count) { +static void init(struct timeout *timeout, size_t count, int verbose) { size_t i; min_heap_ctor(&timeouts); diff --git a/bench-wheel.c b/bench-wheel.c index 51177a3..62d658a 100644 --- a/bench-wheel.c +++ b/bench-wheel.c @@ -5,7 +5,7 @@ static struct timeouts timeouts; -static void init(struct timeout *timeout, size_t count) { +static void init(struct timeout *timeout, size_t count, int verbose) { size_t i; timeouts_init(&timeouts, TIMEOUT_mHZ); @@ -13,6 +13,10 @@ static void init(struct timeout *timeout, size_t count) { for (i = 0; i < count; i++) { timeout_init(&timeout[i], 0); } + +#if TIMEOUT_DEBUG - 0 + timeout_debug = verbose; +#endif } /* init() */ @@ -203,7 +203,7 @@ int main(int argc, char **argv) { errx(1, "%s: %s", MAIN.path, dlerror()); MAIN.vops = *vops; - MAIN.vops.init(MAIN.timeout, MAIN.count); + MAIN.vops.init(MAIN.timeout, MAIN.count, MAIN.verbose); while (fgets(cmd, sizeof cmd, stdin) && parseop(&op, cmd)) { struct timeout *to; @@ -43,7 +43,7 @@ struct op *parseop(struct op *, char *ln); struct vops { - void (*init)(struct timeout *, size_t); + void (*init)(struct timeout *, size_t, int); void (*add)(struct timeout *, timeout_t); void (*del)(struct timeout *); struct timeout *(*get)(void); |
