All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] trace: more trace events for block and qmp
@ 2011-09-30 16:51 Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 1/3] trace: trace bdrv_open_common() Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-09-30 16:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

This series adds new trace events for correlating filenames with
BlockDriverState pointers and observing QMP monitor command input.  It also
expands the bdrv_co_io_em() trace event to provide more useful information.

Basically small additions to improve observability in QEMU :).

Stefan Hajnoczi (3):
  trace: trace bdrv_open_common()
  trace: trace monitor qmp dispatch/completion
  trace: add arguments to bdrv_co_io_em() trace event

 block.c      |    4 +++-
 monitor.c    |    5 ++++-
 trace-events |    7 ++++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
1.7.6.3

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

* [Qemu-devel] [PATCH 1/3] trace: trace bdrv_open_common()
  2011-09-30 16:51 [Qemu-devel] [PATCH 0/3] trace: more trace events for block and qmp Stefan Hajnoczi
@ 2011-09-30 16:51 ` Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 2/3] trace: trace monitor qmp dispatch/completion Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 3/3] trace: add arguments to bdrv_co_io_em() trace event Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-09-30 16:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

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(-)

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 a31d9aa..79ff5ea 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"
-- 
1.7.6.3

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

* [Qemu-devel] [PATCH 2/3] trace: trace monitor qmp dispatch/completion
  2011-09-30 16:51 [Qemu-devel] [PATCH 0/3] trace: more trace events for block and qmp Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 1/3] trace: trace bdrv_open_common() Stefan Hajnoczi
@ 2011-09-30 16:51 ` Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 3/3] trace: add arguments to bdrv_co_io_em() trace event Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-09-30 16:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

Add trace events for handle_qmp_command(), which dispatches qmp
commands, and monitor_protocol_emitter(), which produces the reply to a
qmp command.

Also remove duplicate #include "trace/control.h".

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

diff --git a/monitor.c b/monitor.c
index 8ec2c5e..0bb88e9 100644
--- a/monitor.c
+++ b/monitor.c
@@ -57,11 +57,11 @@
 #include "json-parser.h"
 #include "osdep.h"
 #include "cpu.h"
+#include "trace.h"
 #include "trace/control.h"
 #ifdef CONFIG_TRACE_SIMPLE
 #include "trace/simple.h"
 #endif
-#include "trace/control.h"
 #include "ui/qemu-spice.h"
 
 //#define DEBUG
@@ -369,6 +369,8 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data)
 {
     QDict *qmp;
 
+    trace_monitor_protocol_emitter(mon);
+
     qmp = qdict_new();
 
     if (!monitor_has_error(mon)) {
@@ -5089,6 +5091,7 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
     qobject_incref(mon->mc->id);
 
     cmd_name = qdict_get_str(input, "execute");
+    trace_handle_qmp_command(mon, cmd_name);
     if (invalid_qmp_mode(mon, cmd_name)) {
         qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
         goto err_out;
diff --git a/trace-events b/trace-events
index 79ff5ea..b982727 100644
--- a/trace-events
+++ b/trace-events
@@ -503,3 +503,7 @@ escc_sunkbd_event_in(int ch) "Untranslated keycode %2.2x"
 escc_sunkbd_event_out(int ch) "Translated keycode %2.2x"
 escc_kbd_command(int val) "Command %d"
 escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=%01x"
+
+# monitor.c
+handle_qmp_command(void *mon, const char *cmd_name) "mon %p cmd_name \"%s\""
+monitor_protocol_emitter(void *mon) "mon %p"
-- 
1.7.6.3

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

* [Qemu-devel] [PATCH 3/3] trace: add arguments to bdrv_co_io_em() trace event
  2011-09-30 16:51 [Qemu-devel] [PATCH 0/3] trace: more trace events for block and qmp Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 1/3] trace: trace bdrv_open_common() Stefan Hajnoczi
  2011-09-30 16:51 ` [Qemu-devel] [PATCH 2/3] trace: trace monitor qmp dispatch/completion Stefan Hajnoczi
@ 2011-09-30 16:51 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-09-30 16:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

It is useful to know the BlockDriverState as well as the
sector_num/nb_sectors of an emulated .bdrv_co_*() request.

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

diff --git a/block.c b/block.c
index 1ae22d5..e865fab 100644
--- a/block.c
+++ b/block.c
@@ -2999,7 +2999,7 @@ static int coroutine_fn bdrv_co_io_em(BlockDriverState *bs, int64_t sector_num,
                              bdrv_co_io_em_complete, &co);
     }
 
-    trace_bdrv_co_io(is_write, acb);
+    trace_bdrv_co_io_em(bs, sector_num, nb_sectors, is_write, acb);
     if (!acb) {
         return -EIO;
     }
diff --git a/trace-events b/trace-events
index b982727..cc20dcb 100644
--- a/trace-events
+++ b/trace-events
@@ -67,7 +67,7 @@ bdrv_aio_writev(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs
 bdrv_lock_medium(void *bs, bool locked) "bs %p locked %d"
 bdrv_co_readv(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d"
 bdrv_co_writev(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d"
-bdrv_co_io(int is_write, void *acb) "is_write %d acb %p"
+bdrv_co_io_em(void *bs, int64_t sector_num, int nb_sectors, int is_write, void *acb) "bs %p sector_num %"PRId64" nb_sectors %d is_write %d acb %p"
 
 # hw/virtio-blk.c
 virtio_blk_req_complete(void *req, int status) "req %p status %d"
-- 
1.7.6.3

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

end of thread, other threads:[~2011-09-30 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-30 16:51 [Qemu-devel] [PATCH 0/3] trace: more trace events for block and qmp Stefan Hajnoczi
2011-09-30 16:51 ` [Qemu-devel] [PATCH 1/3] trace: trace bdrv_open_common() Stefan Hajnoczi
2011-09-30 16:51 ` [Qemu-devel] [PATCH 2/3] trace: trace monitor qmp dispatch/completion Stefan Hajnoczi
2011-09-30 16:51 ` [Qemu-devel] [PATCH 3/3] trace: add arguments to bdrv_co_io_em() trace event 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.