From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Markus Metzger <markus.t.metzger@googlemail.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [draft patch] <unavailable> unwinder for btrace [Re: [rfc 3/5] record: make it build again]
Date: Thu, 28 Mar 2013 17:37:00 -0000 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B2307BA9A2D@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <20130328091204.GA15793@host2.jankratochvil.net>
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Jan Kratochvil
> Sent: Thursday, March 28, 2013 10:12 AM
> > The data structure should only change when there is new trace, which requires
> > the target to continue. "info record" should, like any other record-btrace command,
> > fetch the new trace once and then operate on the cached trace data.
>
> In non-stop mode I belive there will be new btrace info on each "info record"
> command, won't be? I have not tried it but it seems so to me.
Record_btrace_info, like any other record btrace command, calls btrace_fetch.
This queries the target for new branch trace. If there is no new trace, it returns.
Only if there is new trace, it will call btrace_clear and then reconstruct the branch
trace.
All this is per-thread, so the branch trace for each thread should only be reconstructed
when it has changed - in non-stop and stop-all mode.
> > Is there a guarantee that frame_info and frame_id objects are destroyed
> > when the target resumes? Or could I trigger their destruction from within
> > btrace_clear?
>
> "trigger frame_info and frame_id destruction" == reinit_frame_cache().
>
> Accessing frame_info after reinit_frame_cache() is always a crash.
>
> Accessing frame_id after reinit_frame_cache() is safe but one needs to be
> prepared frame_find_by_id may return NULL if it is no longer available.
>
> When you introduce new reinit_frame_cache() call one just needs to be careful
> no caller holds that time a frame_info * pointer in a local variable.
> It would be a bug in such caller to call some non-trivial caller while holding
> frame_info * but there were many such bugs in GDB.
>
> I would not rely on any reinit_frame_cache() calls, calling
> reinit_frame_cache() more times is zero-cost, I think you should call
> reinit_frame_cache() from btrace_clear as you ask above.
Thanks. I'm doing just that. So far, I have not seen any issues.
Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
next prev parent reply other threads:[~2013-03-28 12:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-08 15:30 [rfc 0/5] record-btrace markus.t.metzger
2013-02-08 15:30 ` [rfc 5/5] record, disas: add record disassemble command markus.t.metzger
2013-02-10 22:11 ` Jan Kratochvil
2013-02-08 15:30 ` [rfc 1/5] target: add add_deprecated_target_alias markus.t.metzger
2013-02-10 22:10 ` Jan Kratochvil
2013-02-08 15:31 ` [rfc 4/5] record: default target methods markus.t.metzger
2013-02-10 22:11 ` Jan Kratochvil
2013-02-08 15:31 ` [rfc 3/5] record: make it build again markus.t.metzger
2013-02-10 22:11 ` Jan Kratochvil
2013-02-11 13:41 ` Metzger, Markus T
2013-02-11 14:15 ` Jan Kratochvil
2013-02-11 17:13 ` [draft patch] <unavailable> unwinder for btrace [Re: [rfc 3/5] record: make it build again] Jan Kratochvil
2013-02-11 21:24 ` Tom Tromey
2013-02-13 7:35 ` Metzger, Markus T
2013-02-13 7:58 ` Jan Kratochvil
2013-02-13 8:08 ` Metzger, Markus T
2013-03-27 18:09 ` Metzger, Markus T
2013-03-28 12:38 ` Markus Metzger
[not found] ` <20130328062747.GA27157@host2.jankratochvil.net>
2013-03-28 14:28 ` Metzger, Markus T
2013-03-28 14:38 ` Jan Kratochvil
2013-03-28 17:37 ` Metzger, Markus T [this message]
2013-02-08 15:32 ` [rfc 2/5] record: split record markus.t.metzger
2013-02-10 22:11 ` Jan Kratochvil
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=A78C989F6D9628469189715575E55B2307BA9A2D@IRSMSX102.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=markus.t.metzger@googlemail.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