diff options
author | Christopher Haster <geky@geky.net> | 2022-10-13 19:09:26 +0300 |
---|---|---|
committer | Christopher Haster <geky@geky.net> | 2022-11-15 22:38:13 +0300 |
commit | 3a33c3795bd4543ceddb5ed0ae680425d257b0e3 (patch) | |
tree | 5b14c8b96a7219c3e8c16b23bd244a570f364244 /bd | |
parent | 29cbafeb677c94e3a7d5c4094fe21d118dd5a303 (diff) |
Added perfbd.py and block device performance sampling in bench-runner
Based loosely on Linux's perf tool, perfbd.py uses trace output with
backtraces to aggregate and show the block device usage of all functions
in a program, propagating block devices operation cost up the backtrace
for each operation.
This combined with --trace-period and --trace-freq for
sampling/filtering trace events allow the bench-runner to very
efficiently record the general cost of block device operations with very
little overhead.
Adopted this as the default side-effect of make bench, replacing
cycle-based performance measurements which are less important for
littlefs.
Diffstat (limited to 'bd')
-rw-r--r-- | bd/lfs_emubd.c | 3 | ||||
-rw-r--r-- | bd/lfs_filebd.c | 6 | ||||
-rw-r--r-- | bd/lfs_rambd.c | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/bd/lfs_emubd.c b/bd/lfs_emubd.c index 7372c97..cf82f56 100644 --- a/bd/lfs_emubd.c +++ b/bd/lfs_emubd.c @@ -358,7 +358,8 @@ int lfs_emubd_prog(const struct lfs_config *cfg, lfs_block_t block, } int lfs_emubd_erase(const struct lfs_config *cfg, lfs_block_t block) { - LFS_EMUBD_TRACE("lfs_emubd_erase(%p, 0x%"PRIx32")", (void*)cfg, block); + LFS_EMUBD_TRACE("lfs_emubd_erase(%p, 0x%"PRIx32" (%"PRIu32"))", + (void*)cfg, block, cfg->block_size); lfs_emubd_t *bd = cfg->context; // check if erase is valid diff --git a/bd/lfs_filebd.c b/bd/lfs_filebd.c index 3040735..e214822 100644 --- a/bd/lfs_filebd.c +++ b/bd/lfs_filebd.c @@ -96,7 +96,8 @@ int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, lfs_off_t off, const void *buffer, lfs_size_t size) { - LFS_FILEBD_TRACE("lfs_filebd_prog(%p, 0x%"PRIx32", %"PRIu32", %p, %"PRIu32")", + LFS_FILEBD_TRACE("lfs_filebd_prog(%p, " + "0x%"PRIx32", %"PRIu32", %p, %"PRIu32")", (void*)cfg, block, off, buffer, size); lfs_filebd_t *bd = cfg->context; @@ -127,7 +128,8 @@ int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, } int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block) { - LFS_FILEBD_TRACE("lfs_filebd_erase(%p, 0x%"PRIx32")", (void*)cfg, block); + LFS_FILEBD_TRACE("lfs_filebd_erase(%p, 0x%"PRIx32" (%"PRIu32"))", + (void*)cfg, block, cfg->block_size); // check if erase is valid LFS_ASSERT(block < cfg->block_count); diff --git a/bd/lfs_rambd.c b/bd/lfs_rambd.c index cbdd7d0..ab180b9 100644 --- a/bd/lfs_rambd.c +++ b/bd/lfs_rambd.c @@ -107,7 +107,8 @@ int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, } int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block) { - LFS_RAMBD_TRACE("lfs_rambd_erase(%p, 0x%"PRIx32")", (void*)cfg, block); + LFS_RAMBD_TRACE("lfs_rambd_erase(%p, 0x%"PRIx32" (%"PRIu32"))", + (void*)cfg, block, cfg->block_size); // check if erase is valid LFS_ASSERT(block < cfg->block_count); |