From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28260 invoked by alias); 14 Feb 2011 19:31:00 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 28250 invoked by uid 22791); 14 Feb 2011 19:30:59 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Oleg Nesterov X-Fcc: ~/Mail/utrace Cc: Project Archer Subject: Re: ptrace improvement: PTRACE_O_INHERIT In-Reply-To: Oleg Nesterov's message of Saturday, 12 February 2011 20:02:53 +0100 <20110212190253.GA31866@redhat.com> References: <20110203223905.D0C77180081@magilla.sf.frob.com> <20110210195212.GA3868@redhat.com> <20110211192423.78FFC1802A2@magilla.sf.frob.com> <20110211203755.GA5367@redhat.com> <20110212005855.E764C1814A4@magilla.sf.frob.com> <20110212190253.GA31866@redhat.com> Message-Id: <20110214193052.3EC8D1814BA@magilla.sf.frob.com> Date: Mon, 14 Feb 2011 19:31:00 -0000 X-SW-Source: 2011-q1/txt/msg00050.txt.bz2 > > > I meant, we can intoduce the new W*** flag for do_wait(). If the new > > > tracee was PTRACE_O_INHERIT'ed, do_wait() returns its pid. > > > > I still don't understand the proposal. > > To simplify the explanation, suppose we add task_struct->unknown_tracee > boolean. > > if tracehook_finish_clone()->ptrace_init_task() does __ptrace_link() > because of PTRACE_O_INHERIT, it also sets child->unknown_tracee and > notifies the tracee via do_notify_parent_cldstop(). So the suggestion is to have the tracer see a wait report that simply says "here is a new implicit tracee". I don't see how that is useful at all. It supplies no new information, only mentions the tracee earlier. That makes it a short race window in which it's possible for a tracer to have no possible means of identifying the lineage of an implicit tracee. But it does not solve the problem in the general case. > > Tracing some threads but not all is really an artifact of the ptrace > > interface and not something that any real userland debugger-like thing > > ever wants to do. > > Off-topic note: I disagree very much, but this doesn't matter. I agree > that ptrace nterface should not be per-thread, and gdb always traces all > threads. Then I don't understand at all what you are disagreeing with. You think the interface should not be per-thread, but you don't agree that a per-thread interface is not something debuggers really want? Thanks, Roland