[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Disk Image Read Location
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Disk Image Read Location |
Date: |
Tue, 19 Sep 2017 10:23:07 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Mon, Sep 18, 2017 at 06:47:38PM +0000, Derrick McKee wrote:
> I am trying to figure out if a particular disk operation is reading from
> the same location in an image file.
The following trace event is fired when a BlockBackend (a drive) is
read:
# block/block-backend.c
blk_co_preadv(void *blk, void *bs, int64_t offset, unsigned int bytes, int
flags) "blk %p bs %p offset %"PRId64" bytes %u flags 0x%x"
Here is an example:
$ qemu-system-x86_64 -M accel=kvm -m 1G -cpu host \
-trace enable=blk_co_preadv \
-drive if=virtio,file=test.img,format=raw
address@hidden:blk_co_preadv blk 0x55f703389390 bs 0x55f7033895f0 offset 0
bytes 512 flags 0x0
address@hidden:blk_co_preadv blk 0x55f703389390 bs 0x55f7033895f0 offset 0
bytes 512 flags 0x0
"offset" is the byte address that the guest is reading from.
See docs/devel/tracing.txt for more information on tracing. One or more
tracing backends are compiled into QEMU. By default the "log" backend
prints to stderr.
If you are using the QEMU binary from a Linux distribution package, they
may have compiled in only the SystemTap backend so try compiling your
own QEMU if you don't see any output from the example above.
Stefan