From owner-freebsd-current@FreeBSD.ORG Tue Feb 7 20:46:34 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6716A106566B for ; Tue, 7 Feb 2012 20:46:34 +0000 (UTC) (envelope-from dmitrym@juniper.net) Received: from exprod7og112.obsmtp.com (exprod7og112.obsmtp.com [64.18.2.177]) by mx1.freebsd.org (Postfix) with ESMTP id F10128FC12 for ; Tue, 7 Feb 2012 20:46:33 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKTzGNqMcj7vt03H4ewHHnJkAA+aHiTGon@postini.com; Tue, 07 Feb 2012 12:46:34 PST Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 7 Feb 2012 12:45:41 -0800 Received: from [172.24.26.191] (dmitrym-lnx.jnpr.net [172.24.26.191]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q17Kjf107604; Tue, 7 Feb 2012 12:45:41 -0800 (PST) (envelope-from dmitrym@juniper.net) Message-ID: <4F318D74.9030506@juniper.net> Date: Tue, 7 Feb 2012 12:45:40 -0800 From: Dmitry Mikulin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 To: Konstantin Belousov References: <20120125074824.GD2726@deviant.kiev.zoral.com.ua> <4F2094B4.70707@juniper.net> <20120126122326.GT2726@deviant.kiev.zoral.com.ua> <4F22E8FD.6010201@juniper.net> <20120129074843.GL2726@deviant.kiev.zoral.com.ua> <4F26E0D1.8040100@juniper.net> <20120130192727.GZ2726@deviant.kiev.zoral.com.ua> <4F2C756A.80900@juniper.net> <20120204204218.GC3283@deviant.kiev.zoral.com.ua> <4F3043E2.6090607@juniper.net> <20120207121022.GC3283@deviant.kiev.zoral.com.ua> In-Reply-To: <20120207121022.GC3283@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e4081efb-6d29-443c-8708-750833aec629 X-Mailman-Approved-At: Tue, 07 Feb 2012 20:52:09 +0000 Cc: freebsd-current Current , Marcel Moolenaar Subject: Re: [ptrace] please review follow fork/exec changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:46:34 -0000 > So, do you in fact need to distinguish exec stops from syscall exit > against exec stops from PT_FOLLOW_EXEC, This is pretty much what I need. It's the same stop in syscall return right? I don't want to change when the stop happens, I want to have an lwpinfo flag that tells me when a stop occurred in a process under PT_FOLLOW_EXEC. > @@ -889,7 +890,9 @@ exec_fail_dealloc: > > if (error == 0) { > PROC_LOCK(p); > - td->td_dbgflags |= TDB_EXEC; > + if ((p->p_flag& P_TRACED) != 0&& > + ((P_FOLLOWEXEC) != 0 || (p->p_stops& S_PT_SCX) != 0)) > + td->td_dbgflags |= TDB_EXEC; > PROC_UNLOCK(p); > There's a small bug in the patch that makes it not work. The check for P_FOLLOWEXEC should be: + ((p->p_flag& P_FOLLOWEXEC) != 0 || (p->p_stops& S_PT_SCX) != 0)) Looks like the patch should work for me but I need to verify.