From owner-svn-src-all@FreeBSD.ORG Sat Feb 5 23:01:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBFE51065672; Sat, 5 Feb 2011 23:01:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01568FC17; Sat, 5 Feb 2011 23:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p15N1I8w044432; Sat, 5 Feb 2011 23:01:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p15N1IeS044430; Sat, 5 Feb 2011 23:01:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102052301.p15N1IeS044430@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Feb 2011 23:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218357 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 23:01:19 -0000 Author: kib Date: Sat Feb 5 23:01:18 2011 New Revision: 218357 URL: http://svn.freebsd.org/changeset/base/218357 Log: MFC r217820: Document PT_FLAG_FORKED, PT_FOLLOW_FORK, pl_tdname and pl_child_pid. Modified: stable/8/lib/libc/sys/ptrace.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/ptrace.2 ============================================================================== --- stable/8/lib/libc/sys/ptrace.2 Sat Feb 5 23:00:24 2011 (r218356) +++ stable/8/lib/libc/sys/ptrace.2 Sat Feb 5 23:01:18 2011 (r218357) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 10, 2010 +.Dd January 23, 2011 .Dt PTRACE 2 .Os .Sh NAME @@ -295,6 +295,8 @@ struct ptrace_lwpinfo { sigset_t pl_sigmask; sigset_t pl_siglist; siginfo_t pl_siginfo; + char pl_tdname[MAXCOMLEN + 1]; + int pl_child_pid; }; .Ed .Pp @@ -345,6 +347,14 @@ Indicates that member of .Vt "struct ptrace_lwpinfo" contains valid information. +.It PL_FLAG_FORKED +Indicates that the process is returning from a call to +.Fn fork 2 +that created a new child process. +The process identifier of the new process is available in the +.Va pl_child_pid +member of +.Vt "struct ptrace_lwpinfo" . .El .It pl_sigmask The current signal mask of the LWP @@ -356,11 +366,20 @@ on an LWP siglist until the thread is se The siginfo that accompanies the signal pending. Only valid for .Dv PL_EVENT_SIGNAL -kind of stop, when -.Va pl_flags -has +stop when .Dv PL_FLAG_SI -set. +is set in +.Va pl_flags . +.It pl_tdname +The name of the thread. +.It pl_child_pid +The process identifier of the new child process. +Only valid for a +.Dv PL_EVENT_SIGNAL +stop when +.Dv PL_FLAG_FORKED +is set in +.Va pl_flags . .El .It PT_GETNUMLWPS This request returns the number of kernel threads associated with the @@ -391,6 +410,21 @@ This request will trace the specified pr .It PT_SYSCALL This request will trace the specified process on each system call entry and exit. +.It PT_FOLLOW_FORK +This request controls tracing for new child processes of a traced process. +If +.Fa data +is non-zero, +then new child processes will enable tracing and stop before executing their +first instruction. +If +.Fa data +is zero, then new child processes will execute without tracing enabled. +By default, tracing is not enabled for new child processes. +Child processes do not inherit this property. +The traced process will set the +.Dv PL_FLAG_FORKED +flag upon exit from a system call that creates a new process. .It PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from @@ -567,6 +601,7 @@ function appeared in .At v7 . .Sh BUGS The +.Dv PL_FLAG_FORKED , .Dv PL_FLAG_SCE , .Dv PL_FLAG_SCX and