9ae3a8
From 47c61bc22285224ee24a7cbfa822c481f1155a81 Mon Sep 17 00:00:00 2001
9ae3a8
From: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Date: Tue, 7 Oct 2014 14:07:00 +0200
9ae3a8
Subject: [PATCH 42/43] trace: add systemtap-initscript README file to RPM
9ae3a8
9ae3a8
Message-id: <1412690820-31016-12-git-send-email-stefanha@redhat.com>
9ae3a8
Patchwork-id: 61616
9ae3a8
O-Subject: [RHEL7.1 qemu-kvm PATCH 11/11] trace: add systemtap-initscript README file to RPM
9ae3a8
Bugzilla: 1088112
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
The downstream systemtap-initscript integration is undocumented.  Fix
9ae3a8
that with a brief guide containing usage instructions.
9ae3a8
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
(cherry picked from commit d73b49dbbce7535531da5aa1dc640208f18979d2)
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
Conflicts:
9ae3a8
	redhat/qemu-kvm.spec.template
9ae3a8
9ae3a8
This patch is forward-ported from RHEL 6 qemu-kvm.  RHEL 7's
9ae3a8
qemu-kvm.spec.template is significantly different from RHEL 6 so
9ae3a8
adjustments are necessary to include README.systemtap in the RPM.
9ae3a8
---
9ae3a8
 README.systemtap              | 43 +++++++++++++++++++++++++++++++++++++++++++
9ae3a8
 redhat/qemu-kvm.spec.template |  3 ++-
9ae3a8
 2 files changed, 45 insertions(+), 1 deletion(-)
9ae3a8
 create mode 100644 README.systemtap
9ae3a8
9ae3a8
diff --git a/README.systemtap b/README.systemtap
9ae3a8
new file mode 100644
9ae3a8
index 0000000..ad913fc
9ae3a8
--- /dev/null
9ae3a8
+++ b/README.systemtap
9ae3a8
@@ -0,0 +1,43 @@
9ae3a8
+QEMU tracing using systemtap-initscript
9ae3a8
+---------------------------------------
9ae3a8
+
9ae3a8
+You can capture QEMU trace data all the time using systemtap-initscript.  This
9ae3a8
+uses SystemTap's flight recorder mode to trace all running guests to a
9ae3a8
+fixed-size buffer on the host.  Old trace entries are overwritten by new
9ae3a8
+entries when the buffer size wraps.
9ae3a8
+
9ae3a8
+1. Install the systemtap-initscript package:
9ae3a8
+  # yum install systemtap-initscript
9ae3a8
+
9ae3a8
+2. Install the systemtap scripts and the conf file:
9ae3a8
+  # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/
9ae3a8
+  # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/
9ae3a8
+
9ae3a8
+The set of trace events to enable is given in qemu_kvm.stp.  This SystemTap
9ae3a8
+script can be customized to add or remove trace events provided in
9ae3a8
+/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp.
9ae3a8
+
9ae3a8
+SystemTap customizations can be made to qemu_kvm.conf to control the flight
9ae3a8
+recorder buffer size and whether to store traces in memory only or disk too.
9ae3a8
+See stap(1) for option documentation.
9ae3a8
+
9ae3a8
+3. Start the systemtap service.
9ae3a8
+ # service systemtap start qemu_kvm
9ae3a8
+
9ae3a8
+4. Make the service start at boot time.
9ae3a8
+ # chkconfig systemtap on
9ae3a8
+
9ae3a8
+5. Confirm that the service works.
9ae3a8
+  # service systemtap status qemu_kvm
9ae3a8
+  qemu_kvm is running...
9ae3a8
+
9ae3a8
+When you want to inspect the trace buffer, perform the following steps:
9ae3a8
+
9ae3a8
+1. Dump the trace buffer.
9ae3a8
+  # staprun -A qemu_kvm >/tmp/trace.log
9ae3a8
+
9ae3a8
+2. Start the systemtap service because the preceding step stops the service.
9ae3a8
+  # service systemtap start qemu_kvm
9ae3a8
+
9ae3a8
+3. Translate the trace record to readable format.
9ae3a8
+  # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8