2019-12-13 13:10:42 +00:00
|
|
|
|
From 26128b3ede339e292a3c50a84e3248af46ecd0ec Mon Sep 17 00:00:00 2001
|
2018-10-14 17:48:54 +00:00
|
|
|
|
From: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
|
|
Date: Thu, 8 Oct 2015 09:50:17 +0200
|
|
|
|
|
Subject: Add support for simpletrace
|
|
|
|
|
|
|
|
|
|
As simpletrace is upstream, we just need to properly handle it during rpmbuild.
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
2018-11-29 12:09:34 +00:00
|
|
|
|
|
2019-08-15 04:45:41 +00:00
|
|
|
|
Rebase notes (3.1.0):
|
2018-11-29 12:09:34 +00:00
|
|
|
|
- Fixed python 2 to python3 switch
|
|
|
|
|
|
|
|
|
|
Rebase notes (2.9.0):
|
|
|
|
|
- Added group argument for tracetool.py (upstream)
|
|
|
|
|
|
|
|
|
|
Rebase notes (2.8.0):
|
|
|
|
|
- Changed tracetool.py parameters
|
|
|
|
|
|
|
|
|
|
Merged patches (2.3.0):
|
|
|
|
|
- db959d6 redhat/qemu-kvm.spec.template: Install qemu-kvm-simpletrace.stp
|
|
|
|
|
- 5292fc3 trace: add SystemTap init scripts for simpletrace bridge
|
|
|
|
|
- eda9e5e simpletrace: install simpletrace.py
|
|
|
|
|
- 85c4c8f trace: add systemtap-initscript README file to RPM
|
2019-08-19 21:26:36 +00:00
|
|
|
|
|
|
|
|
|
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
2018-10-14 17:48:54 +00:00
|
|
|
|
---
|
|
|
|
|
.gitignore | 2 ++
|
|
|
|
|
Makefile | 4 +++
|
2019-12-13 13:10:42 +00:00
|
|
|
|
README.systemtap | 43 +++++++++++++++++++++++++
|
|
|
|
|
redhat/qemu-kvm.spec.template | 26 ++++++++++++++-
|
2018-10-14 17:48:54 +00:00
|
|
|
|
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +++
|
|
|
|
|
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
|
2019-05-07 21:00:36 +00:00
|
|
|
|
6 files changed, 79 insertions(+), 1 deletion(-)
|
2018-10-14 17:48:54 +00:00
|
|
|
|
create mode 100644 README.systemtap
|
|
|
|
|
create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf
|
|
|
|
|
create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp
|
|
|
|
|
|
|
|
|
|
diff --git a/Makefile b/Makefile
|
2019-12-13 13:10:42 +00:00
|
|
|
|
index 086727dbb9..4254950f7f 100644
|
2018-10-14 17:48:54 +00:00
|
|
|
|
--- a/Makefile
|
|
|
|
|
+++ b/Makefile
|
2019-11-15 14:35:04 +00:00
|
|
|
|
@@ -939,6 +939,10 @@ endif
|
2018-10-14 17:48:54 +00:00
|
|
|
|
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
|
|
|
|
|
done
|
|
|
|
|
$(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
|
|
|
|
|
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/systemtap/script.d"
|
|
|
|
|
+ $(INSTALL_DATA) $(SRC_PATH)/scripts/systemtap/script.d/qemu_kvm.stp "$(DESTDIR)$(qemu_datadir)/systemtap/script.d/"
|
|
|
|
|
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/systemtap/conf.d"
|
|
|
|
|
+ $(INSTALL_DATA) $(SRC_PATH)/scripts/systemtap/conf.d/qemu_kvm.conf "$(DESTDIR)$(qemu_datadir)/systemtap/conf.d/"
|
2019-08-15 04:45:41 +00:00
|
|
|
|
|
|
|
|
|
.PHONY: ctags
|
|
|
|
|
ctags:
|
2018-10-14 17:48:54 +00:00
|
|
|
|
diff --git a/README.systemtap b/README.systemtap
|
|
|
|
|
new file mode 100644
|
2019-12-13 13:10:42 +00:00
|
|
|
|
index 0000000000..ad913fc990
|
2018-10-14 17:48:54 +00:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/README.systemtap
|
|
|
|
|
@@ -0,0 +1,43 @@
|
|
|
|
|
+QEMU tracing using systemtap-initscript
|
|
|
|
|
+---------------------------------------
|
|
|
|
|
+
|
|
|
|
|
+You can capture QEMU trace data all the time using systemtap-initscript. This
|
|
|
|
|
+uses SystemTap's flight recorder mode to trace all running guests to a
|
|
|
|
|
+fixed-size buffer on the host. Old trace entries are overwritten by new
|
|
|
|
|
+entries when the buffer size wraps.
|
|
|
|
|
+
|
|
|
|
|
+1. Install the systemtap-initscript package:
|
|
|
|
|
+ # yum install systemtap-initscript
|
|
|
|
|
+
|
|
|
|
|
+2. Install the systemtap scripts and the conf file:
|
|
|
|
|
+ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/
|
|
|
|
|
+ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/
|
|
|
|
|
+
|
|
|
|
|
+The set of trace events to enable is given in qemu_kvm.stp. This SystemTap
|
|
|
|
|
+script can be customized to add or remove trace events provided in
|
|
|
|
|
+/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp.
|
|
|
|
|
+
|
|
|
|
|
+SystemTap customizations can be made to qemu_kvm.conf to control the flight
|
|
|
|
|
+recorder buffer size and whether to store traces in memory only or disk too.
|
|
|
|
|
+See stap(1) for option documentation.
|
|
|
|
|
+
|
|
|
|
|
+3. Start the systemtap service.
|
|
|
|
|
+ # service systemtap start qemu_kvm
|
|
|
|
|
+
|
|
|
|
|
+4. Make the service start at boot time.
|
|
|
|
|
+ # chkconfig systemtap on
|
|
|
|
|
+
|
|
|
|
|
+5. Confirm that the service works.
|
|
|
|
|
+ # service systemtap status qemu_kvm
|
|
|
|
|
+ qemu_kvm is running...
|
|
|
|
|
+
|
|
|
|
|
+When you want to inspect the trace buffer, perform the following steps:
|
|
|
|
|
+
|
|
|
|
|
+1. Dump the trace buffer.
|
|
|
|
|
+ # staprun -A qemu_kvm >/tmp/trace.log
|
|
|
|
|
+
|
|
|
|
|
+2. Start the systemtap service because the preceding step stops the service.
|
|
|
|
|
+ # service systemtap start qemu_kvm
|
|
|
|
|
+
|
|
|
|
|
+3. Translate the trace record to readable format.
|
|
|
|
|
+ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log
|
|
|
|
|
diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf
|
|
|
|
|
new file mode 100644
|
2019-12-13 13:10:42 +00:00
|
|
|
|
index 0000000000..372d8160a4
|
2018-10-14 17:48:54 +00:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/scripts/systemtap/conf.d/qemu_kvm.conf
|
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
|
+# Force load uprobes (see BZ#1118352)
|
|
|
|
|
+stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true
|
|
|
|
|
+
|
|
|
|
|
+qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes
|
|
|
|
|
diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp
|
|
|
|
|
new file mode 100644
|
2019-12-13 13:10:42 +00:00
|
|
|
|
index 0000000000..c04abf9449
|
2018-10-14 17:48:54 +00:00
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/scripts/systemtap/script.d/qemu_kvm.stp
|
|
|
|
|
@@ -0,0 +1 @@
|
|
|
|
|
+probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {}
|
|
|
|
|
--
|
2019-12-13 13:10:42 +00:00
|
|
|
|
2.21.0
|
2018-10-14 17:48:54 +00:00
|
|
|
|
|