Patchwork [5/5] qdev-monitor: add device_add tracepoint

login
register
mail settings
Submitter Kazuya Saito
Date March 22, 2013, 8:29 a.m.
Message ID <514C167B.8050605@jp.fujitsu.com>
Download mbox | patch
Permalink /patch/229910/
State New
Headers show

Comments

Kazuya Saito - March 22, 2013, 8:29 a.m.
This patch adds tracepoints at device-add command. It enables us to
clarify whether the trouble is caused by hot-plug through commands of
virsh (libvirt).

Signed-off-by: Kazuya Saito <saito.kazuya@jp.fujitsu.com>
---
 qdev-monitor.c |    2 ++
 trace-events   |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 9a78ccf..80881f5 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -23,6 +23,7 @@ 
 #include "qmp-commands.h"
 #include "sysemu/arch_init.h"
 #include "qemu/config-file.h"
+#include "trace.h"

 /*
  * Aliases were a bad idea from the start.  Let's keep them
@@ -473,6 +474,7 @@  DeviceState *qdev_device_add(QemuOpts *opts)
     /* create device, set properties */
     qdev = DEVICE(object_new(driver));
     qdev_set_parent_bus(qdev, bus);
+    trace_device_add(qdev, bus);

     id = qemu_opts_id(opts);
     if (id) {
diff --git a/trace-events b/trace-events
index 235b978..f23b820 100644
--- a/trace-events
+++ b/trace-events
@@ -1106,3 +1106,6 @@  kvm_run_exit(uint32_t reason) "reason %d"
 # qdev.c
 qdev_create(void *dev, void *bus) "dev %p, bus %p"
 qdev_free(void *dev, void *bus) "dev %p, bus %p"
+
+# qdev-monitor.c
+device_add(void *dev, void *bus) "dev %p, bus %p"