xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Plumb through xen-platform device logging
@ 2013-07-04 15:33 Paul Durrant
  2013-07-11  8:23 ` Paul Durrant
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Durrant @ 2013-07-04 15:33 UTC (permalink / raw)
  To: xen-devel; +Cc: Paul Durrant

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@citrix.com>
---
 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

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

end of thread, other threads:[~2013-07-11 14:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-04 15:33 [PATCH] Plumb through xen-platform device logging Paul Durrant
2013-07-11  8:23 ` Paul Durrant
2013-07-11 11:43   ` Ian Campbell
2013-07-11 12:07     ` Paul Durrant
2013-07-11 12:25       ` Don Slutz
2013-07-11 12:28       ` Don Slutz
2013-07-11 13:15         ` Paul Durrant
2013-07-11 12:50       ` Ian Campbell
2013-07-11 13:54         ` Anthony PERARD
2013-07-11 13:59           ` Paul Durrant
2013-07-11 14:01       ` Ian Campbell
2013-07-11 14:49         ` Paul Durrant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).