From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH] btrace: diagnose "record btrace pt" without libipt
Date: Fri, 20 Nov 2015 12:11:00 -0000 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B23332283DF@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <564F0591.3020006@redhat.com>
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Friday, November 20, 2015 12:36 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH] btrace: diagnose "record btrace pt" without libipt
>
> On 11/20/2015 09:17 AM, Markus Metzger wrote:
> > If GDB has been configured without libipt support, i.e. HAVE_LIBIPT is
> > undefined, and is running on a system that supports Intel(R) Processor
> Trace,
> > GDB will run into an internal error when trying to decode the trace.
> >
> > (gdb) record btrace
> > (gdb) s
> > usage (name=0x7fffffffe954 "fib-64")
> > at src/fib.c:12
> > 12 fprintf(stderr, "usage: %s <num>\n", name);
> > (gdb) info record
> > Active record target: record-btrace
> > Recording format: Intel(R) Processor Trace.
> > Buffer size: 16kB.
> > gdb/btrace.c:971: internal-error: Unexpected branch trace format.
> > A problem internal to GDB has been detected,
> > further debugging may prove unreliable.
> > Quit this debugging session? (y or n)
> >
> > This requires a system with Linux kernel 4.1 or later running on a 5th
> > Generation Intel Core processor or later.
> >
> > When trying to enable branch tracing, in addition to checking the target
> > support for the requested branch tracing format, also check whether GDB
> > supports. it.
>
> BTW, this made me wonder what happens if you're remote debugging with
> gdbserver, and then:
>
> #1 - enable btrace pt
> #2 - disconnect with "disconnect"
> #3 - restart gdb
> #4 - reconnect to gdbserver
>
> - Does gdb sync the "btrace-enabled" state with the server? Or does it get
> out
> of sync and confused?
The record target is popped off the target stack on disconnect. This disables
branch tracing. The below log is for BTS but the logic is the same for PT.
(gdb) rec b
[record-btrace] open
[record-btrace] open
[btrace] enable thread 1 (Thread 135520)
Sending packet: $Qbtrace-conf:bts:size=0x10000#e3...Packet received: OK
Sending packet: $Qbtrace:bts#45...Packet received: OK
Sending packet: $qXfer:btrace-conf:read::0,fff#5c...Packet received: l<!DOCTYPE btrace-conf SYSTEM "btrace- conf.dtd">\n<btrace-conf version="1.0">\n<bts size="0x10000" />\n</btrace-conf>\n\000
[btrace] compute ftrace
[record-btrace] attach thread observer
(gdb) info rec
Active record target: record-btrace
[record-btrace] info
Recording format: Branch Trace Store.
Buffer size: 64kB.
[btrace] fetch thread 1 (Thread 135520)
Sending packet: $qXfer:btrace:read:delta:0,fff#93...Packet received: l<!DOCTYPE btrace SYSTEM "btrace.dtd">\n<btrace version="1.0">\n<block begin="0x0" end="0x7ffff7ddc423"/>\n</btrace>\n\000
Recorded 0 instructions in 0 functions (0 gaps) for thread 1 (Thread 135520).
(gdb) disconnect
Sending packet: $qTStatus#49...Packet received: T0;tnotrun:0;tframes:0;tcreated:0;tfree:500000;tsize:500000;circular:0;disconn:0;starttime:0;stoptime:0;username:;notes::
record: disconnect record-btrace
record: stop record-btrace
[record-btrace] stop recording
[record-btrace] detach thread observer
[btrace] disable thread 1 (Thread 135520)
Sending packet: $Qbtrace:off#37...Packet received: OK
[btrace] clear thread 1 (Thread 135520)
record: unpush record-btrace
Ending remote debugging.
[btrace] free objfile
[btrace] free objfile
(gdb)
After reconnecting, you need to enable btrace again.
Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2015-11-20 12:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 9:17 Markus Metzger
2015-11-20 11:31 ` Pedro Alves
2015-11-20 11:35 ` Pedro Alves
2015-11-20 12:11 ` Metzger, Markus T [this message]
2015-11-20 13:12 ` Pedro Alves
2015-11-20 13:59 ` Metzger, Markus T
2015-11-25 16:38 ` Pedro Alves
2015-11-26 7:12 ` Metzger, Markus T
2015-11-26 9:43 ` Pedro Alves
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=A78C989F6D9628469189715575E55B23332283DF@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@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