Patchwork [2/4] trace: trace bdrv_open_common()

login
register
mail settings
Submitter Stefan Hajnoczi
Date Oct. 3, 2011, 11:30 a.m.
Message ID <1317641447-8084-3-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/117441/
State New
Headers show

Comments

Stefan Hajnoczi - Oct. 3, 2011, 11:30 a.m.
bdrv_open_common() is a useful point to trace since it reveals the
filename and block driver for a given BlockDriverState.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 block.c      |    2 ++
 trace-events |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/block.c b/block.c
index e3fe97f..1ae22d5 100644
--- a/block.c
+++ b/block.c
@@ -475,6 +475,8 @@  static int bdrv_open_common(BlockDriverState *bs, const char *filename,
 
     assert(drv != NULL);
 
+    trace_bdrv_open_common(bs, filename, flags, drv->format_name);
+
     bs->file = NULL;
     bs->total_sectors = 0;
     bs->encrypted = 0;
diff --git a/trace-events b/trace-events
index b7ddf14..f408564 100644
--- a/trace-events
+++ b/trace-events
@@ -56,6 +56,7 @@  virtio_console_chr_read(unsigned int port, int size) "port %u, size %d"
 virtio_console_chr_event(unsigned int port, int event) "port %u, event %d"
 
 # block.c
+bdrv_open_common(void *bs, const char *filename, int flags, const char *format_name) "bs %p filename \"%s\" flags %#x format_name \"%s\""
 multiwrite_cb(void *mcb, int ret) "mcb %p ret %d"
 bdrv_aio_multiwrite(void *mcb, int num_callbacks, int num_reqs) "mcb %p num_callbacks %d num_reqs %d"
 bdrv_aio_multiwrite_earlyfail(void *mcb) "mcb %p"