On Mon, May 15, 2023 at 03:26:43AM -0400, Kent Overstreet wrote: > On Mon, May 15, 2023 at 12:13:43AM -0700, Eric Biggers wrote: > > Sure, given that this is an optimization problem with a very small scope > > (decoding 6 fields from a bitstream), I was hoping for something easier and > > faster to iterate on than setting up a full kernel + bcachefs test environment > > and reverse engineering 500 lines of shell script. But sure, I can look into > > that when I have a chance. > > If you were actually wanting to help, that repository is the tool I use > for kernel development and testing - it's got documentation. > > It builds a kernel, boots a VM and runs a test in about 15 seconds, no > need for lifting that code out to userspace. > FYI, I had a go with your test framework today, but I ran into too many problems to really bother with it. In case you want to improve it, these are the problems I ran into (so far). The command I was trying to run, after having run './root_image create' as root as the README says to do, was 'build-test-kernel run -I ~/src/ktest/tests/bcachefs/perf.ktest': - Error due to ~/src/ktest/tests/bcachefs/bcachefs-tools not existing. Worked around by cloning the bcachefs-tools repo to this location. (Note, it's not a git submodule, so updating the git submodules didn't help.) - Error due to "Root image not found". Worked around by recursively chown'ing /var/lib/ktest from root to my user. (Note, the README says to run 'root_image create' as root, which results in root ownership.) - Error due to "cannot set up guest memory 'pc.ram': Cannot allocate memory". Worked around by editing tests/bcachefs/perf.ktest to change config-mem from 32G to 16G. (I have 32G memory total on this computer.) - Error due to "failed to open /dev/vfio/10: No such file or directory". Enabling CONFIG_VFIO and CONFIG_VFIO_PCI in my host kernel didn't help. It seems the test is hardcoded to expect PCI passthrough to be set up with a specific device. I'd have expected it to just set up a standard virtual disk.