From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>, patches@linaro.org
Subject: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support
Date: Thu, 14 May 2015 17:43:52 +0100 [thread overview]
Message-ID: <1431621835-7565-1-git-send-email-peter.maydell@linaro.org> (raw)
This patchset adds support for two new commands to our
gdb scripts, which allow dynamically enabling and disabling
tracing of events, like this:
(gdb) source scripts/qemu-gdb.py
(gdb) qemu trace-enable translate_block
Enabled trace event translate_block
Breakpoint 1 at 0xb634f: file ../trace/generated-tracers.h, line 4734.
(gdb) run
[...]
translate_block: tb:0x7fffc69ce010, pc:0x40000000, tb_code:0x7fffd39ce000
translate_block: tb:0x7fffc69ce078, pc:0x40010000, tb_code:0x7fffd39ce140
translate_block: tb:0x7fffc69ce0e0, pc:0x40010034, tb_code:0x7fffd39ce180
translate_block: tb:0x7fffc69ce148, pc:0x40013700, tb_code:0x7fffd39ce1d0
translate_block: tb:0x7fffc69ce1b0, pc:0x40013710, tb_code:0x7fffd39ce270
translate_block: tb:0x7fffc69ce218, pc:0x4001003c, tb_code:0x7fffd39ce310
[etc]
This works by setting custom breakpoints on the stub functions
trace_<eventname> that the null tracing backend creates. It
probably doesn't work with an optimised build, but on the other
hand because it's purely implemented within gdb you can use a
tool like 'rr' (http://rr-project.org/) to record a run with no
tracing enabled and then turn the tracing on and off as you desire
during the replay.
Patches one and two do some initial splitting of qemu-gdb.py into
separate modules just to keep it from growing unhelpfully large.
-- PMM
Peter Maydell (3):
scripts/qemu-gdb: Split MtreeCommand into its own module
scripts/qemu-gdb: Split CoroutineCommand into its own file
scripts/qemu-gdb: Add support for printing trace events
scripts/qemu-gdb.py | 144 +++------------------------------
scripts/qemugdb/__init__.py | 28 +++++++
scripts/qemugdb/coroutine.py | 91 +++++++++++++++++++++
scripts/qemugdb/mtree.py | 82 +++++++++++++++++++
scripts/qemugdb/trace.py | 188 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 398 insertions(+), 135 deletions(-)
create mode 100644 scripts/qemugdb/__init__.py
create mode 100644 scripts/qemugdb/coroutine.py
create mode 100644 scripts/qemugdb/mtree.py
create mode 100644 scripts/qemugdb/trace.py
--
1.9.1
next reply other threads:[~2015-05-14 16:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 16:43 Peter Maydell [this message]
2015-05-14 16:43 ` [Qemu-devel] [PATCH 1/3] scripts/qemu-gdb: Split MtreeCommand into its own module Peter Maydell
2015-05-14 16:43 ` [Qemu-devel] [PATCH 2/3] scripts/qemu-gdb: Split CoroutineCommand into its own file Peter Maydell
2015-05-14 16:43 ` [Qemu-devel] [PATCH 3/3] scripts/qemu-gdb: Add support for printing trace events Peter Maydell
2015-09-22 14:52 ` Paolo Bonzini
2015-09-22 15:39 ` Peter Maydell
2015-05-15 7:58 ` [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support Markus Armbruster
2015-05-15 9:09 ` Peter Maydell
2015-05-15 12:18 ` Markus Armbruster
2015-05-15 12:39 ` Jan Kiszka
2015-05-15 13:21 ` Markus Armbruster
2015-05-15 13:36 ` Jan Kiszka
2015-05-15 14:18 ` Markus Armbruster
2015-05-18 13:28 ` Stefan Hajnoczi
2015-05-18 13:31 ` 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=1431621835-7565-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).