From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xen.org
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [PATCH] Plumb through xen-platform device logging
Date: Thu, 4 Jul 2013 16:33:02 +0100 [thread overview]
Message-ID: <1372951983-28428-1-git-send-email-paul.durrant@citrix.com> (raw)
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
next reply other threads:[~2013-07-04 15:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-04 15:33 Paul Durrant [this message]
2013-07-11 8:23 ` [PATCH] Plumb through xen-platform device logging 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372951983-28428-1-git-send-email-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).