From nobody@FreeBSD.org  Wed Jul 31 18:15:14 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id EABA8AEF
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 31 Jul 2013 18:15:14 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id D891520EF
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 31 Jul 2013 18:15:14 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6VIFEcK050829
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 31 Jul 2013 18:15:14 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6VIFE6D050639;
	Wed, 31 Jul 2013 18:15:14 GMT
	(envelope-from nobody)
Message-Id: <201307311815.r6VIFE6D050639@oldred.freebsd.org>
Date: Wed, 31 Jul 2013 18:15:14 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] Fixed vfork/rfork arguments in truss(1)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         180976
>Category:       bin
>Synopsis:       [PATCH] Fixed vfork/rfork arguments in truss(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    markj
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 31 18:20:00 UTC 2013
>Closed-Date:    Thu Aug 15 04:12:21 UTC 2013
>Last-Modified:  Thu Aug 15 04:12:21 UTC 2013
>Originator:     Yuri
>Release:        9.1
>Organization:
n/a
>Environment:
>Description:
Currently truss shows vfork like this:
73278: vfork(0x622780,0x40d98e,0x801439408,0x80142f105,0x4,0x0) = 73279 (0x11e3f)

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: usr.bin/truss/syscalls.c
===================================================================
--- usr.bin/truss/syscalls.c	(revision 251126)
+++ usr.bin/truss/syscalls.c	(working copy)
@@ -93,6 +93,9 @@
 	{ .name = "fcntl", .ret_type = 1, .nargs = 3,
 	  .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } },
 	{ .name = "fork", .ret_type = 1, .nargs = 0 },
+	{ .name = "vfork", .ret_type = 1, .nargs = 0 },
+	{ .name = "rfork", .ret_type = 1, .nargs = 1, },
+	  .args = { { Int, 0 } } },
 	{ .name = "getegid", .ret_type = 1, .nargs = 0 },
 	{ .name = "geteuid", .ret_type = 1, .nargs = 0 },
 	{ .name = "getgid", .ret_type = 1, .nargs = 0 },


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: markj 
State-Changed-When: Thu Aug 1 02:59:43 UTC 2013 
State-Changed-Why:  
A fix was committed as r253850. 


Responsible-Changed-From-To: freebsd-bugs->markj 
Responsible-Changed-By: markj 
Responsible-Changed-When: Thu Aug 1 02:59:43 UTC 2013 
Responsible-Changed-Why:  
A fix was committed as r253850. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/180976: commit references a PR
Date: Thu,  1 Aug 2013 02:57:13 +0000 (UTC)

 Author: markj
 Date: Thu Aug  1 02:57:04 2013
 New Revision: 253850
 URL: http://svnweb.freebsd.org/changeset/base/253850
 
 Log:
   Properly print arguments to vfork(2) and rfork(2).
   
   PR:		180976
   Submitted by:	Yuri <yuri@tsoft.com> (original patch)
   MFC after:	1 week
 
 Modified:
   head/usr.bin/truss/syscall.h
   head/usr.bin/truss/syscalls.c
 
 Modified: head/usr.bin/truss/syscall.h
 ==============================================================================
 --- head/usr.bin/truss/syscall.h	Thu Aug  1 01:18:51 2013	(r253849)
 +++ head/usr.bin/truss/syscall.h	Thu Aug  1 02:57:04 2013	(r253850)
 @@ -40,7 +40,7 @@ enum Argtype { None = 1, Hex, Octal, Int
  	Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres,
  	Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open,
  	Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2,
 -	Pathconf };
 +	Pathconf, Rforkflags };
  
  #define	ARG_MASK	0xff
  #define	OUT	0x100
 
 Modified: head/usr.bin/truss/syscalls.c
 ==============================================================================
 --- head/usr.bin/truss/syscalls.c	Thu Aug  1 01:18:51 2013	(r253849)
 +++ head/usr.bin/truss/syscalls.c	Thu Aug  1 02:57:04 2013	(r253850)
 @@ -93,6 +93,9 @@ static struct syscall syscalls[] = {
  	{ .name = "fcntl", .ret_type = 1, .nargs = 3,
  	  .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } },
  	{ .name = "fork", .ret_type = 1, .nargs = 0 },
 +	{ .name = "vfork", .ret_type = 1, .nargs = 0 },
 +	{ .name = "rfork", .ret_type = 1, .nargs = 1,
 +	  .args = { { Rforkflags, 0 } } },
  	{ .name = "getegid", .ret_type = 1, .nargs = 0 },
  	{ .name = "geteuid", .ret_type = 1, .nargs = 0 },
  	{ .name = "getgid", .ret_type = 1, .nargs = 0 },
 @@ -369,6 +372,11 @@ static struct xlat pathconf_arg[] = {
  	XEND
  };
  
 +static struct xlat rfork_flags[] = {
 +	X(RFPROC) X(RFNOWAIT) X(RFFDG) X(RFCFDG) X(RFTHREAD) X(RFMEM)
 +	X(RFSIGSHARE) X(RFTSIGZMB) X(RFLINUXTHPN) XEND
 +};
 +
  #undef X
  #undef XEND
  
 @@ -906,6 +914,9 @@ print_arg(struct syscall_args *sc, unsig
  	case Pathconf:
  		tmp = strdup(xlookup(pathconf_arg, args[sc->offset]));
  		break;
 +	case Rforkflags:
 +		tmp = strdup(xlookup_bits(rfork_flags, args[sc->offset]));
 +		break;
  	case Sockaddr: {
  		struct sockaddr_storage ss;
  		char addr[64];
 _______________________________________________
 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: markj 
State-Changed-When: Thu Aug 15 04:12:20 UTC 2013 
State-Changed-Why:  
The fix has been MFCed to stable/9 and stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=180976 
>Unformatted:
