* [Qemu-devel] Functions to intercept Disk IO information?
@ 2015-10-21 17:13 QuQ Edsel
2015-10-22 1:22 ` Fam Zheng
0 siblings, 1 reply; 4+ messages in thread
From: QuQ Edsel @ 2015-10-21 17:13 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]
Hi,
My friends and I were assigned a task to find out a point to insert a
callback function to intercept Disk IO activities such as read/write a .txt
file. Our final goal is to generate a report for target process/file 's
Disk IO activities. We have QEMU 2.3 with KVM enabled. We have been looking
for such a point for long...but not so capable of such a task.
People who had this project last year done so with TEMU 1.0 (probably QEMU
0.9), and the implementation point they had is dma_buf_rw(). The
information in their report shows pid, timestamps, disk sector, buffer size
and write/read for a target file (I am not even sure if such information is
meaningful or useful)
Currently I have tried to printf in functions such as dma_buf_rw /
dma_blk_io / bdrv_aio_readv...etc. to see if they print out message when I
open/edit/save a .txt or .jpeg file. The first one just don't print at all,
and the second and third one print a lot after booting up the guest....
I can see that the dma_blk_io function call in ide_dma_cb (core.c) may be
related because it prints as I have activities on files. However it also
prints sometime when I am not doing any thing... so I not that certain
about it. (and I don't know if write/read activities invoke such
function..)
Is there a correct /better point to intercept disk IO information
?(especially for activities such as read/write a .file)
Or what should I do to clearly get the needed information from Disk IO
functions?
I would be so grateful to have the information.
Thank you.
The guest environment I have is 64bit Windows 7 with qcow2 image (not sure
if relative)
Edsel
[-- Attachment #2: Type: text/html, Size: 1802 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Functions to intercept Disk IO information?
2015-10-21 17:13 [Qemu-devel] Functions to intercept Disk IO information? QuQ Edsel
@ 2015-10-22 1:22 ` Fam Zheng
2015-10-22 6:18 ` QuQ Edsel
0 siblings, 1 reply; 4+ messages in thread
From: Fam Zheng @ 2015-10-22 1:22 UTC (permalink / raw)
To: QuQ Edsel; +Cc: qemu-devel
On Thu, 10/22 01:13, QuQ Edsel wrote:
> Hi,
> My friends and I were assigned a task to find out a point to insert a
> callback function to intercept Disk IO activities such as read/write a .txt
> file. Our final goal is to generate a report for target process/file 's
> Disk IO activities. We have QEMU 2.3 with KVM enabled. We have been looking
> for such a point for long...but not so capable of such a task.
> People who had this project last year done so with TEMU 1.0 (probably QEMU
> 0.9), and the implementation point they had is dma_buf_rw(). The
> information in their report shows pid, timestamps, disk sector, buffer size
> and write/read for a target file (I am not even sure if such information is
> meaningful or useful)
> Currently I have tried to printf in functions such as dma_buf_rw /
> dma_blk_io / bdrv_aio_readv...etc. to see if they print out message when I
> open/edit/save a .txt or .jpeg file. The first one just don't print at all,
> and the second and third one print a lot after booting up the guest....
> I can see that the dma_blk_io function call in ide_dma_cb (core.c) may be
> related because it prints as I have activities on files. However it also
> prints sometime when I am not doing any thing... so I not that certain
> about it. (and I don't know if write/read activities invoke such
> function..)
Yes, dma_buf_rw should handle all your I/O unless you're doing PIO. I think the
other activities you see when you're not doing anything is from guest system's
background tasks.
Thanks,
Fam
>
> Is there a correct /better point to intercept disk IO information
> ?(especially for activities such as read/write a .file)
> Or what should I do to clearly get the needed information from Disk IO
> functions?
> I would be so grateful to have the information.
> Thank you.
>
> The guest environment I have is 64bit Windows 7 with qcow2 image (not sure
> if relative)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Functions to intercept Disk IO information?
2015-10-22 1:22 ` Fam Zheng
@ 2015-10-22 6:18 ` QuQ Edsel
2015-10-22 6:55 ` Fam Zheng
0 siblings, 1 reply; 4+ messages in thread
From: QuQ Edsel @ 2015-10-22 6:18 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2656 bytes --]
Thank you for reply!
But as I insert a printf message in dma_buf_rw, compile and boot up the VM,
there are no messages printed even when I open/create/edit a .txt or .jpeg
file ?
If dma_buf_rw is called it is supposed to print messages in the monitor...
On the other hand,
the dma_blk_io called in ide_dma_ cb did happen when files are
manipulated....
Would it be point to determine Disk IO and to intercept the information I
need?
Sorry I really lack knowledge in this field...
Does the PIO you mentioned means NIC IO?
Edsel
2015-10-22 9:22 GMT+08:00 Fam Zheng <famz@redhat.com>:
> On Thu, 10/22 01:13, QuQ Edsel wrote:
> > Hi,
> > My friends and I were assigned a task to find out a point to insert a
> > callback function to intercept Disk IO activities such as read/write a
> .txt
> > file. Our final goal is to generate a report for target process/file 's
> > Disk IO activities. We have QEMU 2.3 with KVM enabled. We have been
> looking
> > for such a point for long...but not so capable of such a task.
> > People who had this project last year done so with TEMU 1.0 (probably
> QEMU
> > 0.9), and the implementation point they had is dma_buf_rw(). The
> > information in their report shows pid, timestamps, disk sector, buffer
> size
> > and write/read for a target file (I am not even sure if such information
> is
> > meaningful or useful)
> > Currently I have tried to printf in functions such as dma_buf_rw /
> > dma_blk_io / bdrv_aio_readv...etc. to see if they print out message when
> I
> > open/edit/save a .txt or .jpeg file. The first one just don't print at
> all,
> > and the second and third one print a lot after booting up the guest....
> > I can see that the dma_blk_io function call in ide_dma_cb (core.c) may be
> > related because it prints as I have activities on files. However it also
> > prints sometime when I am not doing any thing... so I not that certain
> > about it. (and I don't know if write/read activities invoke such
> > function..)
>
> Yes, dma_buf_rw should handle all your I/O unless you're doing PIO. I
> think the
> other activities you see when you're not doing anything is from guest
> system's
> background tasks.
>
> Thanks,
> Fam
>
> >
> > Is there a correct /better point to intercept disk IO information
> > ?(especially for activities such as read/write a .file)
> > Or what should I do to clearly get the needed information from Disk IO
> > functions?
> > I would be so grateful to have the information.
> > Thank you.
> >
> > The guest environment I have is 64bit Windows 7 with qcow2 image (not
> sure
> > if relative)
> >
>
[-- Attachment #2: Type: text/html, Size: 3289 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Functions to intercept Disk IO information?
2015-10-22 6:18 ` QuQ Edsel
@ 2015-10-22 6:55 ` Fam Zheng
0 siblings, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2015-10-22 6:55 UTC (permalink / raw)
To: QuQ Edsel; +Cc: qemu-devel
On Thu, 10/22 14:18, QuQ Edsel wrote:
> Thank you for reply!
> But as I insert a printf message in dma_buf_rw, compile and boot up the VM,
> there are no messages printed even when I open/create/edit a .txt or .jpeg
> file ?
> If dma_buf_rw is called it is supposed to print messages in the monitor...
> On the other hand,
> the dma_blk_io called in ide_dma_ cb did happen when files are
> manipulated....
Yes, it was a mistake, I meant dma_blk_io, sorry for confusion. :) dma_buf_rw
only works for some device types, while dma_blk_io works more commonly.
> Would it be point to determine Disk IO and to intercept the information I
> need?
> Sorry I really lack knowledge in this field...
> Does the PIO you mentioned means NIC IO?
PIO is port I/O which doesn't use DMA.
Fam
>
> Edsel
>
> 2015-10-22 9:22 GMT+08:00 Fam Zheng <famz@redhat.com>:
>
> > On Thu, 10/22 01:13, QuQ Edsel wrote:
> > > Hi,
> > > My friends and I were assigned a task to find out a point to insert a
> > > callback function to intercept Disk IO activities such as read/write a
> > .txt
> > > file. Our final goal is to generate a report for target process/file 's
> > > Disk IO activities. We have QEMU 2.3 with KVM enabled. We have been
> > looking
> > > for such a point for long...but not so capable of such a task.
> > > People who had this project last year done so with TEMU 1.0 (probably
> > QEMU
> > > 0.9), and the implementation point they had is dma_buf_rw(). The
> > > information in their report shows pid, timestamps, disk sector, buffer
> > size
> > > and write/read for a target file (I am not even sure if such information
> > is
> > > meaningful or useful)
> > > Currently I have tried to printf in functions such as dma_buf_rw /
> > > dma_blk_io / bdrv_aio_readv...etc. to see if they print out message when
> > I
> > > open/edit/save a .txt or .jpeg file. The first one just don't print at
> > all,
> > > and the second and third one print a lot after booting up the guest....
> > > I can see that the dma_blk_io function call in ide_dma_cb (core.c) may be
> > > related because it prints as I have activities on files. However it also
> > > prints sometime when I am not doing any thing... so I not that certain
> > > about it. (and I don't know if write/read activities invoke such
> > > function..)
> >
> > Yes, dma_buf_rw should handle all your I/O unless you're doing PIO. I
> > think the
> > other activities you see when you're not doing anything is from guest
> > system's
> > background tasks.
> >
> > Thanks,
> > Fam
> >
> > >
> > > Is there a correct /better point to intercept disk IO information
> > > ?(especially for activities such as read/write a .file)
> > > Or what should I do to clearly get the needed information from Disk IO
> > > functions?
> > > I would be so grateful to have the information.
> > > Thank you.
> > >
> > > The guest environment I have is 64bit Windows 7 with qcow2 image (not
> > sure
> > > if relative)
> > >
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-22 6:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 17:13 [Qemu-devel] Functions to intercept Disk IO information? QuQ Edsel
2015-10-22 1:22 ` Fam Zheng
2015-10-22 6:18 ` QuQ Edsel
2015-10-22 6:55 ` Fam Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).