From nobody@FreeBSD.org  Sun Oct 19 13:53:45 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D60921065688
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 19 Oct 2008 13:53:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id C52F08FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 19 Oct 2008 13:53:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JDrj3e055432
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 19 Oct 2008 13:53:45 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id m9JDrj00055431;
	Sun, 19 Oct 2008 13:53:45 GMT
	(envelope-from nobody)
Message-Id: <200810191353.m9JDrj00055431@www.freebsd.org>
Date: Sun, 19 Oct 2008 13:53:45 GMT
From: Mateusz Guzik <mjguzik@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] man page truss(1) claims that init(8) can be traced
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         128222
>Category:       docs
>Synopsis:       [patch] man page truss(1) claims that init(8) can be traced
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 19 14:00:09 UTC 2008
>Closed-Date:    Mon Jun 06 22:15:13 UTC 2011
>Last-Modified:  Mon Jun  6 22:20:07 UTC 2011
>Originator:     Mateusz Guzik
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD eternal 8.0-CURRENT FreeBSD 8.0-CURRENT #14: Mon Sep 15 17:38:51 CEST 2008     f@eternal:/usr/obj/usr/src/sys/ETERNAL  i386

>Description:
In truss(1) one can find the following:
# Follow an already-running process
           $ truss -p 1

but:
# truss -p 1
truss: can not attach to target process: Invalid argument

(It fails because init(8) is marked as a system process and ptrace doesn't allow to trace these.)

>How-To-Repeat:
Run `trace -p 1`
>Fix:
Change pid 1 to for example 34, as in the man page for ktrace(1).

Patch attached with submission follows:

--- usr.bin/truss/truss.1.orig	2008-10-19 14:47:33.000000000 +0200
+++ usr.bin/truss/truss.1	2008-10-19 15:41:01.000000000 +0200
@@ -85,7 +85,7 @@
 # Do the same, but put the output into a file
 .Dl $ truss -o /tmp/truss.out /bin/echo hello
 # Follow an already-running process
-.Dl $ truss -p 1
+.Dl $ truss -p 34
 .Sh SEE ALSO
 .Xr kdump 1 ,
 .Xr ktrace 1 ,


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: trhodes 
State-Changed-When: Fri Jan 23 00:58:23 UTC 2009 
State-Changed-Why:  
Tracing init(8) returns EINVAL, I've patched the manual 
page in CURRENT.  Thanks for the submission! 


Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Fri Jan 23 00:58:23 UTC 2009 
Responsible-Changed-Why:  
Over to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128222 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/128222: commit references a PR
Date: Fri, 23 Jan 2009 00:58:27 +0000 (UTC)

 Author: trhodes
 Date: Fri Jan 23 00:58:14 2009
 New Revision: 187607
 URL: http://svn.freebsd.org/changeset/base/187607
 
 Log:
   Attaching to the init process returns EINVAL,
   so give an example that is more likely to work.
   Stolen from the ktrace(1) manual page.
   
   PR:		128222
   Submitted by:	Mateusz Guzik <mjguzik@gmail.com>
 
 Modified:
   head/usr.bin/truss/truss.1
 
 Modified: head/usr.bin/truss/truss.1
 ==============================================================================
 --- head/usr.bin/truss/truss.1	Fri Jan 23 00:51:25 2009	(r187606)
 +++ head/usr.bin/truss/truss.1	Fri Jan 23 00:58:14 2009	(r187607)
 @@ -1,6 +1,6 @@
  .\" $FreeBSD$
  .\"
 -.Dd January 2, 2004
 +.Dd January 22, 2009
  .Dt TRUSS 1
  .Os
  .Sh NAME
 @@ -85,7 +85,7 @@ options are mutually exclusive.)
  # Do the same, but put the output into a file
  .Dl $ truss -o /tmp/truss.out /bin/echo hello
  # Follow an already-running process
 -.Dl $ truss -p 1
 +.Dl $ truss -p 34
  .Sh SEE ALSO
  .Xr kdump 1 ,
  .Xr ktrace 1 ,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: gjb 
State-Changed-When: Mon Jun 6 22:15:01 UTC 2011 
State-Changed-Why:  
MFCd to stable/7. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=128222 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/128222: commit references a PR
Date: Mon,  6 Jun 2011 22:15:10 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Mon Jun  6 22:14:46 2011
 New Revision: 222792
 URL: http://svn.freebsd.org/changeset/base/222792
 
 Log:
   MFC 187607 [1]:
   
   Attaching to the init process returns EINVAL,
   so give an example that is more likely to work.
   Stolen from the ktrace(1) manual page.
   
   PR:		128222
   Original commit by:	trhodes
 
 Modified:
   stable/7/usr.bin/truss/truss.1
 Directory Properties:
   stable/7/usr.bin/truss/   (props changed)
 
 Modified: stable/7/usr.bin/truss/truss.1
 ==============================================================================
 --- stable/7/usr.bin/truss/truss.1	Mon Jun  6 22:06:42 2011	(r222791)
 +++ stable/7/usr.bin/truss/truss.1	Mon Jun  6 22:14:46 2011	(r222792)
 @@ -1,6 +1,6 @@
  .\" $FreeBSD$
  .\"
 -.Dd January 2, 2004
 +.Dd January 22, 2009
  .Dt TRUSS 1
  .Os
  .Sh NAME
 @@ -85,7 +85,7 @@ options are mutually exclusive.)
  # Do the same, but put the output into a file
  .Dl $ truss -o /tmp/truss.out /bin/echo hello
  # Follow an already-running process
 -.Dl $ truss -p 1
 +.Dl $ truss -p 34
  .Sh SEE ALSO
  .Xr kdump 1 ,
  .Xr ktrace 1 ,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
