This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] btrace, x86: disable on some processors
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: "kettenis at gnu dot org" <kettenis at gnu dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "markus dot t dot metzger at gmail dot com" <markus dot t dot metzger at gmail dot com>
- Date: Fri, 22 Feb 2013 09:18:26 +0000
- Subject: RE: [PATCH] btrace, x86: disable on some processors
- References: <1361450669-1054-1-git-send-email-markus.t.metzger@intel.com> <20130221183925.GA25096@host2.jankratochvil.net>
> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Thursday, February 21, 2013 7:39 PM
Thanks for your review.
> > + file = syscall (SYS_perf_event_open, &attr, child, -1, -1, 0);
> > + if (file >= 0)
> > + close (file);
> > +
>
> I would put here one kill (child, SIGKILL); before that PTRACE_KILL.
> See linux-nat.c kill_callback or:
> http://sourceware.org/ml/archer/2011-q1/msg00102.html
> It probably cannot happen here but just to be sure.
>
>
> > + status = ptrace (PTRACE_KILL, child, NULL, NULL);
> > + if (status != 0)
> > + warning (_("test branch tracing: cannot kill forked child: %s."),
> > + strerror (errno));
> > + else
> > + {
> > + pid = waitpid (child, &status, 0);
When I send SIGKILL and then PTRACE_KILL, should I wait unconditionally?
I.e. can we be sure that our child still ptraced when it receives the SIGKILL?
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