From owner-svn-src-head@freebsd.org Wed Dec 30 00:04:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD47A5578A; Wed, 30 Dec 2015 00:04:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 092CC10A4; Wed, 30 Dec 2015 00:04:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBU04woG037479; Wed, 30 Dec 2015 00:04:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBU04wb8037478; Wed, 30 Dec 2015 00:04:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512300004.tBU04wb8037478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 30 Dec 2015 00:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292896 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2015 00:04:59 -0000 Author: jhb Date: Wed Dec 30 00:04:57 2015 New Revision: 292896 URL: https://svnweb.freebsd.org/changeset/base/292896 Log: Document the recently added support for ptrace(2) LWP events. Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Wed Dec 30 00:04:33 2015 (r292895) +++ head/lib/libc/sys/ptrace.2 Wed Dec 30 00:04:57 2015 (r292896) @@ -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 October 20, 2015 +.Dd December 29, 2015 .Dt PTRACE 2 .Os .Sh NAME @@ -372,6 +372,20 @@ The flag is set for first event reported automatically attached due to .Dv PT_FOLLOW_FORK enabled. +.It PL_FLAG_BORN +This flag is set for the first event reported from a new LWP when LWP +events are enabled via +.Dv PT_LWP_EVENTS . +It is reported along with +.Dv PL_FLAG_SCX +and is always reported if LWP events are enabled. +.It PL_FLAG_EXITED +This flag is set for the last event reported by an exiting LWP when +LWP events are enabled via +.Dv PT_LWP_EVENTS . +Note that this event is not reported when the last LWP in a process exits. +The termination of the last thread is reported via a normal process exit +event. .El .It pl_sigmask The current signal mask of the LWP @@ -463,6 +477,29 @@ Child processes do not inherit this prop The traced process will set the .Dv PL_FLAG_FORKED flag upon exit from a system call that creates a new process. +.It PT_LWP_EVENTS +This request controls tracing of LWP creation and destruction. +If +.Fa data +is non-zero, +then LWPs will stop to report creation and destruction events. +If +.Fa data +is zero, +then LWP creation and destruction events will not be reported. +By default, tracing is not enabled for LWP events. +Child processes do not inherit this property. +New LWPs will stop to report an event with +.Dv PL_FLAG_BORN +set before executing their first instruction. +Exiting LWPs will stop to report an event with +.Dv PL_FLAG_EXITED +set before completing their termination. +.Pp +Note that new processes do not report an event for the creation of their +initial thread, +and exiting processes do not report an event for the termination of the +last thread. .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