qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support
Date: Mon, 18 May 2015 14:28:18 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, May 14, 2015 at 05:43:52PM +0100, Peter Maydell wrote:
> 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.

Did you try GDB's static probe points support?
https://sourceware.org/gdb/onlinedocs/gdb/Static-Probe-Points.html

I think QEMU binaries built with the SystemTap/DTrace backend can be
traced by GDB.

Stefan

Attachment: pgp4rVKbW8bAU.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]