yeahuh / rpms / qemu-kvm

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