I'm doing something like a *simple and lightweight* REPLAY program out of QEMU, only including CPU, MEMORY, and DISK. I'm implementing it with a shadow CPU (register state), shadow memory(from *"pmemsave"*) and shadow * ".img"* file (disk).
When I get the *"log exec,op"*(preferred) or *"log exec,in_asm"*instruction traces from monitor in whole-system emulation mode, the final step to replay read/write a file to/from the disk seems the *"in/ins"* and * "out/outs"* instructions(translated into a *CALL* instruction in Intermediate Representation of QEMU), which can set DMA and transfer data. But from the instruction traces, I don't know which location in the *".img"*file (disk) has been accessed. (It's also hard to find out which file has been read/written in higher semantics.) Any easy approach to do this? Thanks so much. On Fri, Jun 1, 2012 at 4:09 AM, Stefan Hajnoczi <stefa...@gmail.com> wrote: > On Fri, Jun 1, 2012 at 4:11 AM, Yue Chen <ycyc...@gmail.com> wrote: > > Any approach to log all the file read/write (I/O data flow) in order, > > together with the instruction traces in QEMU? Thanks. > > It sounds like you may be running a *-user target because softmmu > (system emulation) has no knowledge of file I/O inside the guest. > Please give more details of what you're trying to do if this is > incorrect. > > It sounds like you want strace together with -d in_asm output. Have > you seen linux-user/strace.c? > > Stefan >