I'm using qemu to boot a Live CD to trace the order in which files are opened in the CD image, with a view to re-ordering the contents of the ISO to put those at the beginning of the ISO for a faster boot time (using genisoimage -sort).
[An alternative would be to monitor the blocks read from the ISO and make those sequential in the ISO, but that's harder...]
So my question is how to go about this? I see qemu -trace but don't see an option for file opening (except v9fs_open, which produces no output). I can also pass different command-line arguments to the guest kernel if that's useful
Thanks!
QEMU's CD image emulation doesn't work at the 'file' level. It just provides a block device (an emulated CDROM drive), and doesn't care at all about the content of those blocks. It's up to the guest OS to decide what it wants to interpret the contents as and how it wants to implement a filesystem on top of that.
If you want to log the order of files being opened you'll need to get your guest OS to do that somehow, I think.