diff mbox

[v3,08/13] trace: add qdev_global_prop_apply

Message ID 1497876588-947-9-git-send-email-peterx@redhat.com
State New
Headers show

Commit Message

Peter Xu June 19, 2017, 12:49 p.m. UTC
Trace global property applying. Now there are machine compat properties,
accel compat properties, and user specified global properties. It
provides a way to trace those properties that really applied.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 Makefile.objs             | 1 +
 hw/core/qdev-properties.c | 2 ++
 hw/core/trace-events      | 2 ++
 3 files changed, 5 insertions(+)
 create mode 100644 hw/core/trace-events
diff mbox

Patch

diff --git a/Makefile.objs b/Makefile.objs
index 0575802..e199f5d 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -121,6 +121,7 @@  trace-events-subdirs += migration
 trace-events-subdirs += block
 trace-events-subdirs += backends
 trace-events-subdirs += chardev
+trace-events-subdirs += hw/core
 trace-events-subdirs += hw/block
 trace-events-subdirs += hw/block/dataplane
 trace-events-subdirs += hw/char
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index e9efb78..69c3f15 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -10,6 +10,7 @@ 
 #include "net/hub.h"
 #include "qapi/visitor.h"
 #include "chardev/char.h"
+#include "trace.h"
 
 void qdev_prop_set_after_realize(DeviceState *dev, const char *name,
                                   Error **errp)
@@ -1150,6 +1151,7 @@  static void qdev_prop_set_globals_for_type(DeviceState *dev,
         if (strcmp(typename, prop->driver) != 0) {
             continue;
         }
+        trace_qdev_global_prop_apply(typename, prop->property, prop->value);
         prop->used = true;
         object_property_parse(OBJECT(dev), prop->value, prop->property, &err);
         if (err != NULL) {
diff --git a/hw/core/trace-events b/hw/core/trace-events
new file mode 100644
index 0000000..0a0a79f
--- /dev/null
+++ b/hw/core/trace-events
@@ -0,0 +1,2 @@ 
+# hw/core/qdev-properties.c
+qdev_global_prop_apply(const char *type, const char *prop, const char *value) "type '%s' prop '%s' value '%s'"