From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuL5n-0001ow-Ck for qemu-devel@nongnu.org; Mon, 18 May 2015 09:28:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuL5k-0000iu-4l for qemu-devel@nongnu.org; Mon, 18 May 2015 09:28:27 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:34924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuL5j-0000io-To for qemu-devel@nongnu.org; Mon, 18 May 2015 09:28:24 -0400 Received: by wgfl8 with SMTP id l8so36558212wgf.2 for ; Mon, 18 May 2015 06:28:23 -0700 (PDT) Date: Mon, 18 May 2015 14:28:18 +0100 From: Stefan Hajnoczi Message-ID: <20150518132818.GH24319@stefanha-thinkpad.redhat.com> References: <1431621835-7565-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="it/zdz3K1bH9Y8/E" Content-Disposition: inline In-Reply-To: <1431621835-7565-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , patches@linaro.org --it/zdz3K1bH9Y8/E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > (gdb) source scripts/qemu-gdb.py=20 > (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] >=20 > This works by setting custom breakpoints on the stub functions > trace_ 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 --it/zdz3K1bH9Y8/E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVWejyAAoJEJykq7OBq3PIe1wH/RkD+OXZ/axnfQGONe24PBkV X7cwPKxsaImEcc2ZrnH+W+3eWQcWAW7opXsDLvaOAzwvNQOujRgmWK4Quy33MLBv ULC7AeoHjw7hrAkZudJimP3G55Xhgf0SKIOlflr8hJGBRhMbJfCEV/dA3VBlD0Xq dx9MOzPLkXWj3HsQjdlOVHUsgnMk0sdKxgPSh4XyRK9vGSHvTx0UoHFjhwLqqYQr 1Rbuvc7qMCisuu1l9yYRR0L65JaTgnvf/Om6Ygxib6oZPMNQUgzHT4QO5GhJSSjZ vBhOuxztCRBLKnk4oCpPG++TstwarJ8xlub/H+/BrlPYvZtoF/zTwwpJCEDvPvM= =mKc3 -----END PGP SIGNATURE----- --it/zdz3K1bH9Y8/E--