runners: Adopted compile-time optional kiwibd as emubd alternative
kiwibd has been used extensively in external benchmarks, it makes sense to make it the default bd for the bench runner: - test_runner - defaults to emubd - more testing features - bench_runner - defaults to kiwibd - lighter-weight disks The benefit of kiwibd is the disk is just one big blob of RAM, so basically no overhead. This is important when benchmarking on multi-GiB disks. emubd is much heavy, but as a tradeoff can do quite a bit more: bad-block simulation, wear simulation, snapshotting, etc. --- In theory the bd used by each runner can be controlled at compile-time by defining -DBENCH_EMUBD, etc, but I have a feeling no one will ever use this.
This commit is contained in:
@@ -8,6 +8,23 @@
|
||||
#define TEST_RUNNER_H
|
||||
|
||||
|
||||
// default to using emubd for tests
|
||||
#if !defined(TEST_EMUBD) && !defined(TEST_KIWIBD)
|
||||
#define TEST_EMUBD
|
||||
#endif
|
||||
|
||||
// ifdef macros for emubd vs kiwibd
|
||||
#ifdef TEST_EMUBD
|
||||
#define TEST_IFDEF_EMUBD(a, b) (a)
|
||||
#else
|
||||
#define TEST_IFDEF_EMUBD(a, b) (b)
|
||||
#endif
|
||||
#ifdef TEST_KIWIBD
|
||||
#define TEST_IFDEF_KIWIBD(a, b) (a)
|
||||
#else
|
||||
#define TEST_IFDEF_KIWIBD(a, b) (b)
|
||||
#endif
|
||||
|
||||
// override LFS3_TRACE
|
||||
void test_trace(const char *fmt, ...);
|
||||
|
||||
@@ -18,11 +35,18 @@ void test_trace(const char *fmt, ...);
|
||||
__VA_ARGS__)
|
||||
#define LFS3_TRACE(...) LFS3_TRACE_(__VA_ARGS__, "")
|
||||
#define LFS3_EMUBD_TRACE(...) LFS3_TRACE_(__VA_ARGS__, "")
|
||||
#define LFS3_KIWIBD_TRACE(...) LFS3_TRACE_(__VA_ARGS__, "")
|
||||
|
||||
|
||||
// note these are indirectly included in any generated files
|
||||
#ifndef TEST_KIWIBD
|
||||
#include "bd/lfs3_emubd.h"
|
||||
#else
|
||||
#include "bd/lfs3_kiwibd.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// give source a chance to define feature macros
|
||||
#undef _FEATURES_H
|
||||
|
||||
Reference in New Issue
Block a user