Tweaked mount/format/dbg littlefs info print
The info should now be ordered more-or-less by decreasing importance:
littlefs v2.0 4096x256 0x{0,1}.36d w12.256
^ ^ ^ ^ ^ '-.-' ^ ^ ^
'--|-|----|---|-----|---|-----|---|-- littlefs
'-|----|---|-----|---|-----|---|-- on-disk major version
'----|---|-----|---|-----|---|-- on-disk minor version
'---|-----|---|-----|---|-- block size
'-----|---|-----|---|-- block count
'---|-----|---|-- mroot blocks
'-----|---|-- mroot trunk
'---|-- mtree weight
'-- mweight
This commit is contained in:
@@ -8106,18 +8106,18 @@ int lfsr_mount(lfs_t *lfs, const struct lfs_config *cfg) {
|
||||
|
||||
// TODO this should use any configured values
|
||||
LFS_DEBUG("Mounted littlefs v%"PRId32".%"PRId32" "
|
||||
"%"PRId32"x%"PRId32" "
|
||||
"0x{%"PRIx32",%"PRIx32"}.%"PRIx32" "
|
||||
"w%"PRId32".%"PRId32", "
|
||||
"bd %"PRId32"x%"PRId32,
|
||||
"w%"PRId32".%"PRId32,
|
||||
LFS_DISK_VERSION_MAJOR,
|
||||
LFS_DISK_VERSION_MINOR,
|
||||
lfs->cfg->block_size,
|
||||
lfs->cfg->block_count,
|
||||
lfs->mroot.rbyd.blocks[0],
|
||||
lfs->mroot.rbyd.blocks[1],
|
||||
lfs->mroot.rbyd.trunk,
|
||||
lfsr_mtree_weight(lfs) / lfsr_mweight(lfs),
|
||||
lfsr_mweight(lfs),
|
||||
lfs->cfg->block_size,
|
||||
lfs->cfg->block_count);
|
||||
lfsr_mweight(lfs));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -8132,8 +8132,8 @@ int lfsr_format(lfs_t *lfs, const struct lfs_config *cfg) {
|
||||
return err;
|
||||
}
|
||||
|
||||
LFS_DEBUG("Formatting littlefs v%"PRId32".%"PRId32", "
|
||||
"bd %"PRId32"x%"PRId32,
|
||||
LFS_DEBUG("Formatting littlefs v%"PRId32".%"PRId32" "
|
||||
"%"PRId32"x%"PRId32,
|
||||
LFS_DISK_VERSION_MAJOR,
|
||||
LFS_DISK_VERSION_MINOR,
|
||||
lfs->cfg->block_size,
|
||||
|
||||
+4
-4
@@ -1839,11 +1839,11 @@ def main(disk, mroots=None, *,
|
||||
#### actual debugging begins here
|
||||
|
||||
# print some information about the filesystem
|
||||
print('littlefs v%s.%s %s, rev %d, weight %d.%d, bd %dx%d' % (
|
||||
print('littlefs v%s.%s %dx%d %s, rev %d, weight %d.%d' % (
|
||||
config.version[0] if config.version[0] is not None else '?',
|
||||
config.version[1] if config.version[1] is not None else '?',
|
||||
mroot.addr(), mroot.rev, bweight//mleaf_weight, 1*mleaf_weight,
|
||||
(config.block_size or -1)+1, (config.block_count or -1)+1))
|
||||
(config.block_size or -1)+1, (config.block_count or -1)+1,
|
||||
mroot.addr(), mroot.rev, bweight//mleaf_weight, 1*mleaf_weight))
|
||||
|
||||
# dynamically size the id field
|
||||
w_width = max(
|
||||
@@ -2133,7 +2133,7 @@ if __name__ == "__main__":
|
||||
import argparse
|
||||
import sys
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Debug littlefs's metadata tree.",
|
||||
description="Debug littlefs stuff.",
|
||||
allow_abbrev=False)
|
||||
parser.add_argument(
|
||||
'disk',
|
||||
|
||||
Reference in New Issue
Block a user