From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: saito.kazuya@jp.fujitsu.com,
Stefan Hajnoczi <stefanha@redhat.com>,
vilanova@ac.upc.edu
Subject: [Qemu-devel] [PATCH v2 4/4] trace: install simpletrace SystemTap tapset
Date: Sun, 22 Jun 2014 21:46:07 +0800 [thread overview]
Message-ID: <1403444767-2601-5-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1403444767-2601-1-git-send-email-stefanha@redhat.com>
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 <stefanha@redhat.com>
---
Makefile.target | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile.target b/Makefile.target
index fc5827c..ec7f1b8 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
@@ -198,6 +205,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
next prev parent reply other threads:[~2014-06-22 13:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-22 13:46 [Qemu-devel] [PATCH v2 0/4] trace: add simpletrace-stap format to generate binary trace Stefan Hajnoczi
2014-06-22 13:46 ` [Qemu-devel] [PATCH v2 1/4] trace: extract stap_escape() function for reuse Stefan Hajnoczi
2014-06-22 13:46 ` [Qemu-devel] [PATCH v2 2/4] trace: add tracetool simpletrace_stap format Stefan Hajnoczi
2014-06-22 13:46 ` [Qemu-devel] [PATCH v2 3/4] simpletrace: add simpletrace.py --no-header option Stefan Hajnoczi
2014-06-22 13:46 ` Stefan Hajnoczi [this message]
2014-07-09 7:06 ` [Qemu-devel] [PATCH v2 0/4] trace: add simpletrace-stap format to generate binary trace Stefan Hajnoczi
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=1403444767-2601-5-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=saito.kazuya@jp.fujitsu.com \
--cc=vilanova@ac.upc.edu \
/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).