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 BENCH_RUNNER_H
|
||||
|
||||
|
||||
// default to using kiwibd for benches
|
||||
#if !defined(BENCH_EMUBD) && !defined(BENCH_KIWIBD)
|
||||
#define BENCH_KIWIBD
|
||||
#endif
|
||||
|
||||
// ifdef macros for emubd vs kiwibd
|
||||
#ifdef BENCH_EMUBD
|
||||
#define BENCH_IFDEF_EMUBD(a, b) (a)
|
||||
#else
|
||||
#define BENCH_IFDEF_EMUBD(a, b) (b)
|
||||
#endif
|
||||
#ifdef BENCH_KIWIBD
|
||||
#define BENCH_IFDEF_KIWIBD(a, b) (a)
|
||||
#else
|
||||
#define BENCH_IFDEF_KIWIBD(a, b) (b)
|
||||
#endif
|
||||
|
||||
// override LFS3_TRACE
|
||||
void bench_trace(const char *fmt, ...);
|
||||
|
||||
@@ -18,6 +35,7 @@ void bench_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__, "")
|
||||
|
||||
// BENCH_START/BENCH_STOP macros measure readed/progged/erased bytes
|
||||
// through emubd
|
||||
@@ -36,8 +54,14 @@ void bench_fresult(const char *probe, uintmax_t n, double result);
|
||||
|
||||
|
||||
// note these are indirectly included in any generated files
|
||||
#ifndef BENCH_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