All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option?
       [not found] <CAKtBrB5cpS9Py0fqCZxd10mSh2UkiUZ1hjPockvhhAfvGAFfJQ@mail.gmail.com>
@ 2012-06-01  8:09 ` Stefan Hajnoczi
  2012-06-03 20:50   ` Yue Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-06-01  8:09 UTC (permalink / raw)
  To: Yue Chen; +Cc: qemu-devel

On Fri, Jun 1, 2012 at 4:11 AM, Yue Chen <ycyc321@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option?
  2012-06-01  8:09 ` [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option? Stefan Hajnoczi
@ 2012-06-03 20:50   ` Yue Chen
  2012-06-06 10:23     ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Yue Chen @ 2012-06-03 20:50 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]

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 <stefanha@gmail.com> wrote:

> On Fri, Jun 1, 2012 at 4:11 AM, Yue Chen <ycyc321@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
>

[-- Attachment #2: Type: text/html, Size: 2079 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option?
  2012-06-03 20:50   ` Yue Chen
@ 2012-06-06 10:23     ` Stefan Hajnoczi
  2012-06-07  3:24       ` 陳韋任 (Wei-Ren Chen)
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-06-06 10:23 UTC (permalink / raw)
  To: Yue Chen; +Cc: qemu-devel

On Sun, Jun 3, 2012 at 9:50 PM, Yue Chen <ycyc321@gmail.com> wrote:
> 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).

Why doesn't the "savevm" command provide the snapshotting you need?
It sounds like you're trying to do VM snapshots yourself.

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option?
  2012-06-06 10:23     ` Stefan Hajnoczi
@ 2012-06-07  3:24       ` 陳韋任 (Wei-Ren Chen)
  2012-06-07 15:02         ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-06-07  3:24 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Yue Chen

On Wed, Jun 06, 2012 at 11:23:37AM +0100, Stefan Hajnoczi wrote:
> On Sun, Jun 3, 2012 at 9:50 PM, Yue Chen <ycyc321@gmail.com> wrote:
> > 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).
> 
> Why doesn't the "savevm" command provide the snapshotting you need?
> It sounds like you're trying to do VM snapshots yourself.

  Does `savevm` and reply do the same thing? :)

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option?
  2012-06-07  3:24       ` 陳韋任 (Wei-Ren Chen)
@ 2012-06-07 15:02         ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-06-07 15:02 UTC (permalink / raw)
  To: 陳韋任 (Wei-Ren Chen); +Cc: qemu-devel, Yue Chen

On Thu, Jun 7, 2012 at 4:24 AM, 陳韋任 (Wei-Ren Chen)
<chenwj@iis.sinica.edu.tw> wrote:
> On Wed, Jun 06, 2012 at 11:23:37AM +0100, Stefan Hajnoczi wrote:
>> On Sun, Jun 3, 2012 at 9:50 PM, Yue Chen <ycyc321@gmail.com> wrote:
>> > 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).
>>
>> Why doesn't the "savevm" command provide the snapshotting you need?
>> It sounds like you're trying to do VM snapshots yourself.
>
>  Does `savevm` and reply do the same thing? :)

No.  'savevm' and 'loadvm' are purely for saving and restoring a
snapshot of the VM disk, RAM, and devices.

Replay is something that could be built on top of that snapshotting
functionality, and I think it's something along the lines of why
savevm/loadvm were added and why qcow2 has internal snapshots (before
my time but I think Fabrice was working on something like replay or
reversible debugging).  But replay is really hard for a system that
interacts with the outside world (e.g. internet).

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-07 15:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAKtBrB5cpS9Py0fqCZxd10mSh2UkiUZ1hjPockvhhAfvGAFfJQ@mail.gmail.com>
2012-06-01  8:09 ` [Qemu-devel] Any approach to log the file read/write (I/O data flow) like the "-d in_asm" option? Stefan Hajnoczi
2012-06-03 20:50   ` Yue Chen
2012-06-06 10:23     ` Stefan Hajnoczi
2012-06-07  3:24       ` 陳韋任 (Wei-Ren Chen)
2012-06-07 15:02         ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.