[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/18] trace: install simpletrace SystemTap tapset
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 04/18] trace: install simpletrace SystemTap tapset |
Date: |
Tue, 12 Aug 2014 14:37:41 +0100 |
The simpletrace SystemTap tapset outputs simpletrace binary traces for
SystemTap probes. This is useful because SystemTap has no default way
to format or store traces. The simpletrace SystemTap tapset provides an
easy way to store traces.
The simpletrace.py tool or custom Python scripts using the
simpletrace.py API can analyze SystemTap these traces:
$ ./configure --enable-trace-backends=dtrace ...
$ make && make install
$ stap -e 'probe qemu.system.x86_64.simpletrace.* {}' \
-c qemu-system-x86_64 >/tmp/trace.out
$ scripts/simpletrace.py --no-header trace-events /tmp/trace.out
g_malloc 4.531 pid=15519 size=0xb ptr=0x7f8639c10470
g_malloc 3.264 pid=15519 size=0x300 ptr=0x7f8639c10490
g_free 5.155 pid=15519 ptr=0x7f8639c0f7b0
Note that, unlike qemu-system-x86_64.stp and
qemu-system-x86_64.stp-installed, only one file is needed since the
simpletrace SystemTap tapset does not reference the QEMU binary by path.
Therefore it doesn't matter whether the QEMU binary is installed or not.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
Makefile.target | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile.target b/Makefile.target
index 137d0b0..44fa6a2 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -38,7 +38,7 @@ config-target.h: config-target.h-timestamp
config-target.h-timestamp: config-target.mak
ifdef CONFIG_TRACE_SYSTEMTAP
-stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp
+stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp
ifdef CONFIG_USER_ONLY
TARGET_TYPE=user
@@ -64,6 +64,13 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events
--target-type=$(TARGET_TYPE) \
< $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
+$(QEMU_PROG)-simpletrace.stp: $(SRC_PATH)/trace-events
+ $(call quiet-command,$(TRACETOOL) \
+ --format=simpletrace-stap \
+ --backends=$(TRACE_BACKENDS) \
+ --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
+ < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
+
else
stap:
endif
@@ -191,6 +198,7 @@ endif
ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
$(INSTALL_DATA) $(QEMU_PROG).stp-installed
"$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
+ $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp
"$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
endif
GENERATED_HEADERS += config-target.h
--
1.9.3
- [Qemu-devel] [PULL 00/18] Tracing patches, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 02/18] trace: add tracetool simpletrace_stap format, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 01/18] trace: extract stap_escape() function for reuse, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 04/18] trace: install simpletrace SystemTap tapset,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 03/18] simpletrace: add simpletrace.py --no-header option, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 06/18] trace: [tcg] Argument type transformation rules, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 05/18] trace: [tcg] Add documentation, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 07/18] trace: [tcg] Argument type transformation machinery, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 08/18] trace: [tcg] Add 'tcg' event property, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 10/18] trace: [tcg] Define TCG tracing helper routines, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 09/18] trace: [tcg] Declare TCG tracing helper routines, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 11/18] trace: [tcg] Define TCG tracing helper routine wrappers, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 12/18] trace: [tcg] Include TCG-tracing helpers, Stefan Hajnoczi, 2014/08/12
- [Qemu-devel] [PULL 13/18] trace: [tcg] Generate TCG tracing routines, Stefan Hajnoczi, 2014/08/12