Software development notes
by Andrew
Trying to debug intermittent data corruption under QEMU can be fairly painful, especially if you’re trying to reproduce with stock boot images. I happened to be in this dark corner recently and wanted to enable some extra debug output in the provided kernel. Thankfully Linux supports enabling dynamic debug statements on the kernel commandline, though depending on which statements you want and how you’re trying to enable them this can be a straightforward or like trying to run a Rube Goldberg machine in reverse.
There were several hurdles in my case:
expect(1)
bootargs
via a u-boot scriptAs it turns out there are several relevant points that fall out as a consequence:
\040
to avoid badly split strings
arguments on the kernel commandline.expect
script that does the right thing.In my case the result ended up looking like:
send "setenv bootargs \$bootargs debug systemd.log_target=null dyndbg=\"\\\"format UBI\\\\040DBG\\\\040wl +p\\\"\"\n"