qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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 0/4] trace: add simpletrace-stap format to generate binary trace
Date: Sun, 22 Jun 2014 21:46:03 +0800	[thread overview]
Message-ID: <1403444767-2601-1-git-send-email-stefanha@redhat.com> (raw)

v2:
 * I realized that v1 was not complete enough after feedback from Lluís and
   Frank Ch. Eigler, so here is a v2 after all.
 * Add Makefile target for simpletrace .stp file [Lluís]
 * Generate SystemTap probe aliases so users can select a subset of probes to
   enable [Frank Ch. Eigler]
 * Delete --no-header from sys.argv[] so further command-line parsing works

SystemTap is a popular tracing solution on Fedora and RHEL.  It does not have
its own trace file format, instead stap scripts have the freedom to output data
in whatever format is most appropriate.

QEMU supports the simpletrace binary format for built-in tracing that comes
with QEMU.  Since we need a format for persisting SystemTap traces and a binary
format has performance advantages, let's output simpletrace-compatible data.

This patch adds a new stap file that is autogenerated from trace-events.  The
following example shows how to use SystemTap and analyze the resulting trace
file with simpletrace.py:

  $ ./configure --enable-trace-backend=dtrace ... && make
  $ sudo stap x86_64-softmmu/qemu-system-x86_64-simpletrace.stp >trace
  ...run QEMU in another shell...
  ^C
  $ scripts/simpletrace.py --no-header trace-events trace

One new concept here is the simpletrace.py --no-header option.  SystemTap
supports flight-recorder mode where trace records are written into a ring
buffer.  The ring buffer can be dumped at any time so it is useful to skip the
simpletrace header check.

Stefan Hajnoczi (4):
  trace: extract stap_escape() function for reuse
  trace: add tracetool simpletrace_stap format
  simpletrace: add simpletrace.py --no-header option
  trace: install simpletrace SystemTap tapset

 Makefile.target                              | 10 +++-
 scripts/simpletrace.py                       | 24 +++++++---
 scripts/tracetool/format/simpletrace_stap.py | 71 ++++++++++++++++++++++++++++
 scripts/tracetool/format/stap.py             | 11 +++--
 4 files changed, 105 insertions(+), 11 deletions(-)
 create mode 100644 scripts/tracetool/format/simpletrace_stap.py

-- 
1.9.3

             reply	other threads:[~2014-06-22 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-22 13:46 Stefan Hajnoczi [this message]
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 ` [Qemu-devel] [PATCH v2 4/4] trace: install simpletrace SystemTap tapset Stefan Hajnoczi
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-1-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).