runners: bench: Added BENCH_SIMTIME/SIMRESET/PAUSE/RESUME/etc

- BENCH_SIMTIME()   => lfs3_kiwibd_simtime()
- BENCH_SIMRESET()  => lfs3_kiwibd_simreset()
- BENCH_SIMPAUSE()  => lfs3_kiwibd_simpause()
- BENCH_SIMRESUME() => lfs3_kiwibd_simresume()
- BENCH_RESET()     => lfs3_kiwibd_simreset() + BENCH_STACK/HEAP_RESET()
- BENCH_PAUSE()     => lfs3_kiwibd_simpause() + BENCH_STACK/HEAP_PAUSE()
- BENCH_RESUME()    => lfs3_kiwibd_simresume() + BENCH_STACK/HEAP_RESUME()

This does two things:

1. Adds pause/resume counters to bd counters to make it easier to
   exclude operations from the current bench (potentially useful for
   seq+disk usage).

2. Exposes bd simtime operations as BENCH_* macros, to make it a bit
   easier to interact with simtime without tying all the benches to
   kiwibd. (Not that we'll ever probably not use kiwibd, but still).

Also adopted 32-bit counters for stack/heap pause state instead of a
32-bit stack. Not that either are at a risk of overflowing, but better
safe than sorry.
This commit is contained in:
Christopher Haster
2026-02-07 20:02:26 -06:00
parent f62d91c9b5
commit 10e77d9177
12 changed files with 325 additions and 119 deletions
+11 -1
View File
@@ -179,13 +179,17 @@ typedef struct lfs3_emubd {
// array of copy-on-write blocks
lfs3_emubd_block_t **blocks;
// some other test state
// sim state
uint32_t paused;
// amount read/progged/erased
lfs3_emubd_io_t reads;
lfs3_emubd_io_t progs;
lfs3_emubd_io_t erases;
lfs3_emubd_io_t readed;
lfs3_emubd_io_t progged;
lfs3_emubd_io_t erased;
// some other test state
uint32_t prng;
lfs3_emubd_powercycles_t power_cycles;
lfs3_emubd_block_t **ooo_before;
@@ -239,6 +243,12 @@ lfs3_emubd_sns_t lfs3_emubd_simtime(const struct lfs3_cfg *cfg);
// Reset simulation counters
int lfs3_emubd_simreset(const struct lfs3_cfg *cfg);
// Pause simulation counters
int lfs3_emubd_simpause(const struct lfs3_cfg *cfg);
// Resume simulation counters
int lfs3_emubd_simresume(const struct lfs3_cfg *cfg);
// Get total number of read transactions
lfs3_emubd_sio_t lfs3_emubd_reads(const struct lfs3_cfg *cfg);