[Qemu-devel] [PATCH 1/2] monitor: add handle_hmp_command trace event

Stefan Hajnoczi posted 2 patches 8 years, 5 months ago
[Qemu-devel] [PATCH 1/2] monitor: add handle_hmp_command trace event
Posted by Stefan Hajnoczi 8 years, 5 months ago
It is often useful to correlate QEMU-internal events with monitor
commands that caused them.  Trace the full HMP command being executed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 monitor.c    | 2 ++
 trace-events | 1 +
 2 files changed, 3 insertions(+)

diff --git a/monitor.c b/monitor.c
index baa73c9..1e78d86 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3085,6 +3085,8 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
     QDict *qdict;
     const mon_cmd_t *cmd;
 
+    trace_handle_hmp_command(mon, cmdline);
+
     cmd = monitor_parse_command(mon, &cmdline, mon->cmd_table);
     if (!cmd) {
         return;
diff --git a/trace-events b/trace-events
index 433865f..2de6bec 100644
--- a/trace-events
+++ b/trace-events
@@ -52,6 +52,7 @@ spice_vmc_event(int event) "spice vmc event %d"
 monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p"
 monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p"
 monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64
+handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s"
 
 # dma-helpers.c
 dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d"
-- 
2.9.4


Re: [Qemu-devel] [PATCH 1/2] monitor: add handle_hmp_command trace event
Posted by Eric Blake 8 years, 5 months ago
On 06/05/2017 05:42 AM, Stefan Hajnoczi wrote:
> It is often useful to correlate QEMU-internal events with monitor
> commands that caused them.  Trace the full HMP command being executed.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  monitor.c    | 2 ++
>  trace-events | 1 +
>  2 files changed, 3 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org