-include $(OBJS:.o=.d)
T_SMALLOC_OBJS = t/stest.o
-T_SMALLOC_OBJS += gettime.o mutex.o smalloc.o t/log.o
+T_SMALLOC_OBJS += gettime.o mutex.o smalloc.o t/log.o t/debug.o
T_SMALLOC_PROGS = t/stest
T_IEEE_OBJS = t/ieee754.o
T_AXMAP_PROGS = t/axmap
T_LFSR_TEST_OBJS = t/lfsr-test.o
-T_LFSR_TEST_OBJS += lib/lfsr.o
+T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o t/log.o t/debug.o
T_LFSR_TEST_PROGS = t/lfsr-test
ifeq ($(CONFIG_TARGET_OS), Linux)
ifeq ($(CONFIG_TARGET_OS), Linux)
T_DEDUPE_OBJS = t/dedupe.o
T_DEDUPE_OBJS += lib/rbtree.o t/log.o mutex.o smalloc.o gettime.o crc/md5.o \
- memalign.o lib/bloom.o
+ memalign.o lib/bloom.o t/debug.o
T_DEDUPE_PROGS = t/dedupe
endif
--- /dev/null
+#include <stdio.h>
+
+FILE *f_err;
+struct timeval *fio_tv = NULL;
+unsigned int fio_debug = 0;
+
+void __dprint(int type, const char *str, ...)
+{
+}
+
+void debug_init(void)
+{
+ f_err = stderr;
+}
--- /dev/null
+#ifndef FIO_DEBUG_INC_H
+#define FIO_DEBUG_INC_H
+
+extern void debug_init(void);
+
+#endif
#include "../fio_time.h"
#include "../lib/bloom.h"
-
-FILE *f_err;
-struct timeval *fio_tv = NULL;
-unsigned int fio_debug = 0;
-
-void __dprint(int type, const char *str, ...)
-{
-}
+#include "debug.h"
struct worker_thread {
pthread_t thread;
uint64_t nextents, nchunks;
int c, ret;
+ debug_init();
+
while ((c = getopt(argc, argv, "b:t:d:o:c:p:B:")) != -1) {
switch (c) {
case 'b':
* negligible overhead.
*/
fprintf(stderr, "\nTest initiated... ");
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start);
+ fio_gettime(&start, NULL);
while (!lfsr_next(fl, &i, fl->max_val)) {
if (verify)
*(uint8_t *)(v + i) += 1;
}
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end);
+ fio_gettime(&end, NULL);
fprintf(stderr, "finished.\n");
#include "../smalloc.h"
#include "../flist.h"
-
-FILE *f_err;
-struct timeval *fio_tv = NULL;
-unsigned int fio_debug = 0;
+#include "debug.h"
#define MAGIC1 0xa9b1c8d2
#define MAGIC2 0xf0a1e9b3
int main(int argc, char *argv[])
{
- f_err = stderr;
-
sinit();
+ debug_init();
do_rand_allocs();
scleanup();
return 0;
}
-
-void __dprint(int type, const char *str, ...)
-{
-}