Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-12-17Adopted --subplot* in plot.pyChristopher Haster
As well as --legend* and --*ticklabels. Mostly for close feature parity, making it easier to move plots between plot.py and plotmpl.py.
2022-12-17Added --subplot* to plotmpl.pyChristopher Haster
Driven primarily by a want to compare measurements of different runtime complexities (it's difficult to fit O(n) and O(log n) on the same plot), this adds the ability to nest subplots in the same .svg which try to align as much as possible. This turned out to be surprisingly complicated. As a part of this, adopted matplotlib's relatively recent constrained_layout, which behaves much more consistently. Also dropped --legend-left, no one should really be using that.
2022-12-12Added plotmpl.py --github flag to match the website's foreground/backgroundChristopher Haster
The difference between ggplot's gray and GitHub's gray was a bit jarring. This also adds --foreground and --font-color for this sort of additional color control without needing to add a new flag for every color scheme out there.
2022-12-07Added BENCH/TEST_PRNG, replacing other ad-hoc sources of randomnessChristopher Haster
When you add a function to every benchmark suite, you know if should probably be provided by the benchmark runner itself. That being said, randomness in tests/benchmarks is a bit tricky because it needs to be strictly controlled and reproducible. No global state is used, allowing tests/benches to maintain multiple randomness stream which can be useful for checking results during a run. There's an argument for having global prng state in that the prng could be preserved across power-loss, but I have yet to see a use for this, and it would add a significant requirement to any future test/bench runner.
2022-12-07Changed lfs_emubd_get* -> lfs_emubd_*Christopher Haster
lfs_emubd_getreaded -> lfs_emubd_readed lfs_emubd_getproged -> lfs_emubd_proged lfs_emubd_geterased -> lfs_emubd_erased lfs_emubd_getwear -> lfs_emubd_wear lfs_emubd_getpowercycles -> lfs_emubd_powercycles
2022-12-07Changed test_runner to run with -Pnone,linear by defaultChristopher Haster
The linear powerloss heuristic provides very good powerloss coverage without a significant runtime hit, so there's really no reason to run the tests without -Plinear. Previous behavior can be accomplished with an explicit -Pnone.
2022-12-07Added make benchmarks/testmarks rulesChristopher Haster
Mostly for benchmarking, this makes it easy to view and compare runner results similarly to other csv results.
2022-12-07A couple of script changes after CI integrationChristopher Haster
- Renamed struct_.py -> structs.py again. - Removed lfs.csv, instead prefering script specific csv files. - Added *-diff make rules for quick comparison against a previous result, results are now implicitly written on each run. For example, `make code` creates lfs.code.csv and prints the summary, which can be followed by `make code-diff` to compare changes against the saved lfs.code.csv without overwriting. - Added nargs=? support for -s and -S, now uses a per-result _sort attribute to decide sort if fields are unspecified.
2022-12-07Fixed Clang testing in CI, removed override vars in MakefileChristopher Haster
Two flags introduced: -fcallgraph-info=su for stack analysis, and -ftrack-macro-expansions=0 for cleaner prettyassert.py warnings, are unfortunately not supported in Clang. The override vars in the Makefile meant it wasn't actually possible to remove these flags for Clang testing, so this commit changes those vars to normal, non-overriding vars. This means `make CFLAGS=-Werror` and `CFLAGS=-Werror make` behave _very_ differently, but this is just an unfortunate quirk of make that needs to be worked around.
2022-12-07Merge remote-tracking branch 'origin/master' into test-and-bench-runnersChristopher Haster
2022-12-07Fixed bench workflow + changeprefix issue in prefix releasesChristopher Haster
changeprefix.py only works on prefixes, which is a bit of a problem for flags in the workflow scripts, requiring extra handling to not hide the prefix from changeprefix.py
2022-12-07Added a bot-generated PR-comment with a simple status tableChristopher Haster
The littlefs CI is actually in a nice state that generates a lot of information about PRs (code/stack/struct changes, line/branch coverage changes, benchmark changes), but GitHub's UI has changed overtime to make CI statuses harder to find for some reason. This bot comment should hopefully make this information easy to find without creating too much noise in the discussion. If not, this can always be changed later.
2022-12-07Removed unnecessarily heavy RAM usage from logs in bench/test.pyChristopher Haster
For long running processes (testing with >1pls) these logs can grow into multiple gigabytes, humorously we never access more than the last n lines as requested by --context. Piping the stdout with --stdout does not use additional RAM.
2022-12-07Adopted script changes in GitHub ActionsChristopher Haster
- Moved to Ubuntu 22.04 This notably means we no longer have to bend over backwards to install GCC 10! - Changed shell in gha to include the verbose/undefined flags, making debugging gha a bit less painful - Adopted the new test.py/test_runners framework, which means no more heavy recompilation for different configurations. This reduces the test job runtime from >1 hour to ~15 minutes, while increasing the number of geometries we are testing. - Added exhaustive powerloss testing, because of time constraints this is at most 1pls for general tests, 2pls for a subset of useful tests. - Limited coverage measurements to `make test` Originally I tried to maximize coverage numbers by including coverage from every possible source, including the more elaborate CI jobs which provide an extra level of fuzzing. But this missed the purpose of coverage measurements, which is to find areas where test cases can be improved. We don't want to improve coverage by just shoving more fuzz tests into CI, we want to improve coverage by adding specific, intentioned test cases, that, if they fail, highlight the reason for the failure. With this perspective, maximizing coverage measurement in CI is counter-productive. This changes makes it so the reported coverage is always less than actual CI coverage, but acts as a more useful metric. This also simplifies coverage collection, so that's an extra plus. - Added benchmarks to CI Note this doesn't suffer from inconsistent CPU performance because our benchmarks are based on purely simulated read/prog/erase measurements. - Updated the generated markdown table to include line+branch coverage info and benchmark results.
2022-11-28Fixed a couple corner cases in scripts when fields are emptyChristopher Haster
- Fixed added/removed count in scripts when an entry has no field in the expected results - Fixed a python-sort-type issue when by-field is missing in a result
2022-11-28Fixed incorrect calculation of extra space needed in mdir blocksChristopher Haster
Despite the comment being correct, the calculation is somehow off by a word, meaning something must have been missed. Maybe the space for the move-delete was missed since that was added later to avoid losing move-deletes during relocations. This was found with the new exhaustive power-loss searching added to the test framework with -P2. The exact failure was test_dirs_many_reentrant:2gg2cb:k4o6. This must be the first test that ends up with all possible extra state in a single mdir block.
2022-11-28Fixed hidden orphans by separating deorphan search into two passesChristopher Haster
This happens in rare situations where there is a failed mdir relocation, interrupted by a power-loss, containing the destination of a directory rename operation, where the directory being renamed preceded the relocating mdir in the mdir tail-list. This requires at some point for a previous directory rename to create a cycle. If this happens, it's possible for the half-orphan to contain the only reference to the renamed directory. Since half-orphans contain outdated state when viewed through the mdir tail-list, the renamed directory appears to be a full-orphan until we fix the relocating half-orphan. This causes littlefs to incorrectly remove the renamed directory from the mdir tail-list, causes catastrophic problems down the line. The source of the problem is that the two different types of orphans really operate on two different levels of abstraction: half-orphans fix failed mdir commits, while full-orphans fix directory removes/renames. Conflating the two leads to situations where we attempt to fix assumed problems about the directory tree before we have fixed problems with the mdir state. The fix here is to separate out the deorphan search into two passes: one to fix half-orphans and correct any mdir-commits, restoring the mdirs and gstate to a known good state, then two to fix failed removes/renames. --- This was found with the -Plinear heuristic powerloss testing, which now runs on more geometries. The failing case was: test_relocations_reentrant_renames:112gg261dk1e3f3:123456789abcdefg1h1i1j1k1 l1m1n1o1p1q1r1s1t1u1v1g2h2i2j2k2l2m2n2o2p2q2r2s2t2 Also fixed/tweaked some parts of the test framework as a part of finding this bug: - Fixed off-by-one in exhaustive powerloss state encoding. - Added --gdb-powerloss-before and --gdb-powerloss-after to help debug state changes through a failing powerloss, maybe this should be expanded to any arbitrary powerloss number in the future. - Added lfs_emubd_crc and lfs_emubd_bdcrc to get block/bd crcs for quick state comparisons while debugging. - Fixed bd read/prog/erase counts not being copied during exhaustive powerloss testing. - Fixed small typo in lfs_emubd trace.
2022-11-28Fixed test out-of-space issues with powerloss testingChristopher Haster
These are just incorrect limits in the tests that can be triggered by powerloss testing, which can end up with more metadata-pairs than without powerloss testing due to orphans.
2022-11-17Added a simple help rule to the MakefileChristopher Haster
To run: $ make help
2022-11-17Changed default build target lfs.a -> liblfs.aChristopher Haster
This is the name expected if you are actually linking against littlefs. The use as a default build rule is mostly for linting. Most uses of littlefs likely compile directly with the sources (it is only several K of code), or use their own build system, and the previous name would have made linking a bit of a challenge. Still, this might cause some breakage for someone...
2022-11-17A couple Makefile-related tweaksChristopher Haster
- Changed --(tool)-tool to --(tool)-path in scripts, this seems to be a more common name for this sort of flag. - Changed BUILDDIR to not have implicit slash, makes Makefile internals a bit more readable. - Fixed some outdated names hidden in less-often used ifdefs.
2022-11-16Renamed prefix.py -> changeprefix.py and updated to use argparseChristopher Haster
Added a couple flags to make the script a bit more flexible, and removed littlefs-specific default in line with the other scripts which aren't really littlefs-specific. (These defaults can be moved to the littlefs-specific Makefile easily enough). The original behavior can be reproduced like so: ./script/changeprefix.py lfs lfs2 --git
2022-11-15A number of small script fixes/tweaks from usageChristopher Haster
- Fixed prettyasserts.py parsing when '->' is in expr - Made prettyasserts.py failures not crash (yay dynamic typing) - Fixed the initial state of the emubd disk file to match the internal state in RAM - Fixed true/false getting changed to True/False in test.py/bench.py defines - Fixed accidental substring matching in plot.py's --by comparison - Fixed a missed LFS_BLOCk_CYCLES in test_superblocks.toml that was missed - Changed test.py/bench.py -v to only show commands being run Including the test output is still possible with test.py -v -O-, making the implicit inclusion redundant and noisy. - Added license comments to bench_runner/test_runner
2022-11-15Changed plotmpl.py/plot.py to not treat missing values as discontinuitiesChristopher Haster
2022-11-15Added plotmpl.py for creating svg/png plots with matplotlibChristopher Haster
Note that plotmpl.py tries to share many arguments with plot.py, allowing plot.py to act as a sort of draft mode for previewing plots before creating an svg.
2022-11-15Added teepipe.py and watch.pyChristopher Haster
2022-11-15Added perfbd.py and block device performance sampling in bench-runnerChristopher Haster
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.
2022-11-15Renamed coverage.py -> cov.pyChristopher Haster
2022-11-15Added recursive results to perf.pyChristopher Haster
This adds -P/--propagate and -Z/--depth to perf.py for showing recursive results, making it easy to narrow down on where spikes in performance come from. This ended up being a bit different from stack.py's recursive results, as we end up with different (diminishing) numbers as we descend.
2022-11-15Added perf.py a wrapper around Linux's perf tool for perf samplingChristopher Haster
This provides 2 things: 1. perf integration with the bench/test runners - This is a bit tricky with perf as it doesn't have its own way to combine perf measurements across multiple processes. perf.py works around this by writing everything to a zip file, using flock to synchronize. As a plus, free compression! 2. Parsing and presentation of perf results in a format consistent with the other CSV-based tools. This actually ran into a surprising number of issues: - We need to process raw events to get the information we want, this ends up being a lot of data (~16MiB at 100Hz uncompressed), so we paralellize the parsing of each decompressed perf file. - perf reports raw addresses post-ASLR. It does provide sym+off which is very useful, but to find the source of static functions we need to reverse the ASLR by finding the delta the produces the best symbol<->addr matches. - This isn't related to perf, but decoding dwarf line-numbers is really complicated. You basically need to write a tiny VM. This also turns on perf measurement by default for the bench-runner, but at a low frequency (100 Hz). This can be decreased or removed in the future if it causes any slowdown.
2022-11-15Tweaked scripts to share more code, added coverage calls/hitsChristopher Haster
The main change is requiring field names for -b/-f/-s/-S, this is a bit more powerful, and supports hidden extra fields, but can require a bit more typing in some cases.
2022-11-15Renamed bench_read/prog/erased -> bench_readed/proged/erasedChristopher Haster
Yes this isn't really correct english anymore, but these names avoid the read/read ambiguity.
2022-11-15Added some automatic sizing for field-names in scripts/runnersChristopher Haster
2022-11-15Added stddev/gmean/gstddev to summary.pyChristopher Haster
2022-11-15Several tweaks to script flagsChristopher Haster
- Changed multi-field flags to action=append instead of comma-separated. - Dropped short-names for geometries/powerlosses - Renamed -Pexponential -> -Plog - Allowed omitting the 0 for -W0/-H0/-n0 and made -j0 consistent - Better handling of --xlim/--ylim
2022-11-15Reworked/simplified tracebd.py a bitChristopher Haster
Instead of trying to align to block-boundaries tracebd.py now just aliases to whatever dimensions are provided. Also reworked how scripts handle default sizing. Now using reasonable defaults with 0 being a placeholder for automatic sizing. The addition of -z/--cat makes it possible to pipe directly to stdout. Also added support for dots/braille output which can capture more detail, though care needs to be taken to not rely on accurate coloring.
2022-11-15Consistent handling of by/field arguments for plot.py and summary.pyChristopher Haster
Now both scripts also fallback to guessing what fields to use based on what fields can be converted to integers. This is more falible, and doesn't work for tests/benchmarks, but in those cases explicit fields can be used (which is what would be needed without guessing anyways).
2022-11-15Added plot.py for in-terminal plottingChristopher Haster
2022-11-15Added a quick trie to avoid running redundant test/bench permutationsChristopher Haster
Without this redundant permutations can easily happen with runtime overrides because the different define layers aren't aware of each other. This causes problems for collecting benchmark results.
2022-11-15Added bench.py and bench_runner.c for benchmarkingChristopher Haster
These are really just different flavors of test.py and test_runner.c without support for power-loss testing, but with support for measuring the cumulative number of bytes read, programmed, and erased. Note that the existing define parameterization should work perfectly fine for running benchmarks across various dimensions: ./scripts/bench.py \ runners/bench_runner \ bench_file_read \ -gnor \ -DSIZE='range(0,131072,1024)' Also added a couple basic benchmarks as a starting point.
2022-11-15Cleaned up a number of small tweaks in the scriptsChristopher Haster
- Added the littlefs license note to the scripts. - Adopted parse_intermixed_args everywhere for more consistent arg handling. - Removed argparse's implicit help text formatting as it does not work with perse_intermixed_args and breaks sometimes. - Used string concatenation for argparse everywhere, uses backslashed line continuations only works with argparse because it strips redundant whitespace. - Consistent argparse formatting. - Consistent openio mode handling. - Consistent color argument handling. - Adopted functools.lru_cache in tracebd.py. - Moved unicode printing behind --subscripts in traceby.py, making all scripts ascii by default. - Renamed pretty_asserts.py -> prettyasserts.py. - Renamed struct.py -> struct_.py, the original name conflicts with Python's built in struct module in horrible ways.
2022-11-10Merge pull request #744 from littlefs-project/fix-fetchmatch-err-pathv2.5.1Christopher Haster
Fix lfs_dir_fetchmatch not propogating bd errors correctly in one case
2022-11-10Merge pull request #742 from carlescufi/fix-be-le-conversionsChristopher Haster
lfs_util: Fix endiannes conversion when `LFS_NO_INTRINSICS` is set
2022-11-10Merge pull request #740 from cbiffle/fix-invalid-block-size-reportingChristopher Haster
Fix invalid block size reporting.
2022-11-10Merge pull request #726 from Xenoamor/patch-1Christopher Haster
Improve lfs_file_close usage description
2022-11-10Merge pull request #724 from littlefs-project/clang-lintChristopher Haster
Fix self-assign warnings discovered by clang, remove some warning flags
2022-11-10Merge pull request #715 from Mixaill/patch-1Christopher Haster
lfs_filebd_sync: fix compilation on Windows
2022-11-10Merge pull request #709 from BRTSG-FOSS/hotfix/tests-buffer-overflowChristopher Haster
Fix buffer overflow in tests when using a large block size
2022-11-10Merge pull request #675 from kevinior/lfs_file_rawopen_nomallocChristopher Haster
Fix unused function warning with LFS_NO_MALLOC
2022-11-10Merge pull request #673 from monowii/patch-1Christopher Haster
Fix readme Mbed link