[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Plumb through xen-platform device logging



The xen-platform device uses the QEMU trace framework to log but nothing was 
plumbing this
through to the log file. I've therefore added the appropriate rune to the QEMU 
configure
command line to enable the stderr backend, added an example qemu-trace-events 
file (that just
enables the xen_platform_log event) and added the necessary argument to the 
QEMU command line
that libxl generates to suck in the events file.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 tools/Makefile                   |    3 ++-
 tools/examples/Makefile          |    1 +
 tools/examples/qemu-trace-events |    2 ++
 tools/libxl/libxl_dm.c           |    7 +++++++
 tools/libxl/libxl_paths.c        |    5 +++++
 5 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 tools/examples/qemu-trace-events

diff --git a/tools/Makefile b/tools/Makefile
index e44a3e9..2d791a4 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -202,7 +202,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
                --disable-kvm \
                --disable-docs \
                --python=$(PYTHON) \
-               $(IOEMU_CONFIGURE_CROSS); \
+               $(IOEMU_CONFIGURE_CROSS) \
+               --enable-trace-backend=stderr; \
        $(MAKE) all
 
 subdir-install-qemu-xen-dir: subdir-all-qemu-xen-dir
diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 8cea724..70facb4 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -25,6 +25,7 @@ XEN_CONFIGS += xend-pci-quirks.sxp
 XEN_CONFIGS += xend-pci-permissive.sxp
 XEN_CONFIGS += xl.conf
 XEN_CONFIGS += cpupool
+XEN_CONFIGS += qemu-trace-events
 
 .PHONY: all
 all:
diff --git a/tools/examples/qemu-trace-events b/tools/examples/qemu-trace-events
new file mode 100644
index 0000000..8e316fe
--- /dev/null
+++ b/tools/examples/qemu-trace-events
@@ -0,0 +1,2 @@
+# Enable Xen PCI Platform device logging
+xen_platform_log
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 2924298..35f71cc 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -370,6 +370,13 @@ static char ** 
libxl__build_device_model_args_new(libxl__gc *gc,
                       "-xen-domid",
                       libxl__sprintf(gc, "%d", guest_domid), NULL);
 
+    flexarray_vappend(dm_args,
+                      "-trace",
+                      libxl__sprintf(gc,
+                                     "events=%s/qemu-trace-events",
+                                     libxl__xen_config_dir_path()),
+                      NULL);
+
     flexarray_append(dm_args, "-chardev");
     flexarray_append(dm_args,
                      libxl__sprintf(gc, "socket,id=libxl-cmd,"
diff --git a/tools/libxl/libxl_paths.c b/tools/libxl/libxl_paths.c
index 14b28d1..12993ec 100644
--- a/tools/libxl/libxl_paths.c
+++ b/tools/libxl/libxl_paths.c
@@ -40,6 +40,11 @@ const char *libxl__run_dir_path(void)
     return XEN_RUN_DIR;
 }
 
+const char *libxl__xen_config_dir_path(void)
+{
+    return XEN_CONFIG_DIR;
+}
+
 /*
  * Local variables:
  * mode: C
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.