Commit efd656d6 authored by william's avatar william

pass along verboseness setting to benchmark implementations

parent c06dcf95
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment