From owner-svn-src-user@freebsd.org  Mon Nov 30 08:30:46 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 C5FF5A3A6C1
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:30:46 +0000 (UTC) (envelope-from pho@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 9555214EB;
 Mon, 30 Nov 2015 08:30:46 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8Ujwl034126;
 Mon, 30 Nov 2015 08:30:45 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8Ujcx034125;
 Mon, 30 Nov 2015 08:30:45 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300830.tAU8Ujcx034125@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:30:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291473 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:30:46 -0000

Author: pho
Date: Mon Nov 30 08:30:45 2015
New Revision: 291473
URL: https://svnweb.freebsd.org/changeset/base/291473

Log:
  Limit run time.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/alternativeFlushPath.sh

Modified: user/pho/stress2/misc/alternativeFlushPath.sh
==============================================================================
--- user/pho/stress2/misc/alternativeFlushPath.sh	Mon Nov 30 08:02:52 2015	(r291472)
+++ user/pho/stress2/misc/alternativeFlushPath.sh	Mon Nov 30 08:30:45 2015	(r291473)
@@ -48,7 +48,8 @@ rm -rf $dir
 mkdir -p $dir
 cd $dir
 sed '1,/^EOF/d' < $odir/$0 > $dir/alternativeFlushPath.c
-mycc -o /tmp/alternativeFlushPath -Wall -Wextra alternativeFlushPath.c
+mycc -o /tmp/alternativeFlushPath -Wall -Wextra alternativeFlushPath.c ||
+    exit 1
 rm -f alternativeFlushPath.c
 
 for j in `jot 10`; do
@@ -72,6 +73,8 @@ EOF
 #include <sys/resource.h>
 #include <err.h>
 
+#define MAXNOFILE 500000	/* To limit runtime */
+
 static volatile sig_atomic_t more;
 
 static void
@@ -90,6 +93,8 @@ test(void)
 
         if (getrlimit(RLIMIT_NOFILE, &rlp) == -1)
                 err(1, "getrlimit(RLIMIT_NOFILE)");
+	if (rlp.rlim_cur > MAXNOFILE)
+		rlp.rlim_cur = MAXNOFILE;
 	rlp.rlim_cur /= 10;
         mypid = getpid();
         fd = malloc(rlp.rlim_cur * sizeof(int));

From owner-svn-src-user@freebsd.org  Mon Nov 30 08:34:20 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 873ACA3A803
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:34:20 +0000 (UTC) (envelope-from pho@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 5900A1922;
 Mon, 30 Nov 2015 08:34:20 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8YJHl034907;
 Mon, 30 Nov 2015 08:34:19 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8YJt9034906;
 Mon, 30 Nov 2015 08:34:19 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300834.tAU8YJt9034906@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:34:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291474 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:34:20 -0000

Author: pho
Date: Mon Nov 30 08:34:19 2015
New Revision: 291474
URL: https://svnweb.freebsd.org/changeset/base/291474

Log:
  Limit run time and fix pthread error handling.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/kevent.sh

Modified: user/pho/stress2/misc/kevent.sh
==============================================================================
--- user/pho/stress2/misc/kevent.sh	Mon Nov 30 08:30:45 2015	(r291473)
+++ user/pho/stress2/misc/kevent.sh	Mon Nov 30 08:34:19 2015	(r291474)
@@ -45,9 +45,7 @@ for i in `jot 10`; do
 	for j in `jot 12`; do
 		/tmp/kevent > /dev/null 2>&1 &
 	done
-	for j in `jot 12`; do
-		wait
-	done
+	wait
 done
 rm -f /tmp/kevent
 exit
@@ -59,6 +57,7 @@ EOF
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 #include <unistd.h>
 
 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -69,10 +68,12 @@ static int fd1[2];
 static int fd2[2];
 static int fd3[2];
 
+#define RUNTIME 12
+
 void *
 thr1(void *arg)
 {
-	int n;
+	int n, r;
 	int kq = -1;
 	struct kevent ev[3];
 
@@ -93,13 +94,13 @@ thr1(void *arg)
 	if (kevent(kq, ev, n, NULL, 0, NULL) < 0)
 		err(1, "kevent(). %s:%d", __FILE__, __LINE__);
 
-	if (pthread_mutex_lock(&mutex) == -1)
-		err(1, "pthread_mutex_lock");
+	if ((r = pthread_mutex_lock(&mutex)) != 0)
+		errc(1, r, "pthread_mutex_lock");
 	waiting = 0;
-	if (pthread_cond_signal(&cond) == -1)
-		err(1, "pthread_cond_signal");
-	if (pthread_mutex_unlock(&mutex) == -1)
-		err(1, "pthread_mutex_unlock");
+	if ((r = pthread_cond_signal(&cond)) != 0)
+		errc(1, r, "pthread_cond_signal");
+	if ((r = pthread_mutex_unlock(&mutex)) != 0)
+		errc(1, r, "pthread_mutex_unlock");
 
 	n = 0;
 	EV_SET(&ev[n], fd1[1], EVFILT_WRITE,
@@ -109,22 +110,22 @@ thr1(void *arg)
 		warn("kevent(). %s:%d", __FILE__, __LINE__);
 	close(kq);
 
-//	printf("%s:%d\n", __FILE__, __LINE__); fflush(stdout);
 	return (0);
 }
 
 void *
 thr2(void *arg)
 {
-	if (pthread_mutex_lock(&mutex) == -1)
-		err(1, "pthread_mutex_lock");
+	int r;
+
+	if ((r = pthread_mutex_lock(&mutex)) != 0)
+		errc(1, r, "pthread_mutex_lock");
 	while (waiting == 1) {
-		if (pthread_cond_wait(&cond, &mutex) == -1)
-			err(1, "pthread_cond_wait");
+		if ((r = pthread_cond_wait(&cond, &mutex)) != 0)
+			errc(1, r, "pthread_cond_wait");
 	}
-	if (pthread_mutex_unlock(&mutex) == -1)
-		err(1, "pthread_mutex_unlock");
-//	printf("%s:%d\n", __FILE__, __LINE__); fflush(stdout);
+	if ((r = pthread_mutex_unlock(&mutex)) != 0)
+		errc(1, r, "pthread_mutex_unlock");
 	close(fd1[0]);
 	close(fd1[1]);
 	close(fd2[0]);
@@ -138,12 +139,12 @@ int
 main(int argc, char **argv)
 {
 	pthread_t threads[2];
+	time_t start;
 	int r;
-	int i;
 
-	for (i = 0; i < 10000; i++) {
+	start = time(NULL);
+	while (time(NULL) - start < RUNTIME) {
 		waiting = 1;
-//		printf("%s:%d\n", __FILE__, __LINE__); fflush(stdout);
 		if (pipe(fd1) == -1)
 			err(1, "pipe()");
 		if (pipe(fd2) == -1)
@@ -151,24 +152,24 @@ main(int argc, char **argv)
 		if (pipe(fd3) == -1)
 			err(1, "pipe()");
 
-		if (pthread_mutex_init(&mutex, 0) == -1)
-			err(1, "pthread_mutex_init");
-		if (pthread_cond_init(&cond, NULL) == -1)
-			err(1, "pthread_cond_init");
+		if ((r = pthread_mutex_init(&mutex, 0)) != 0)
+			errc(1, r, "pthread_mutex_init");
+		if ((r = pthread_cond_init(&cond, NULL)) != 0)
+			errc(1, r, "pthread_cond_init");
 
 		if ((r = pthread_create(&threads[0], NULL, thr1, 0)) != 0)
-			err(1, "pthread_create(): %s\n", strerror(r));
+			errc(1, r, "pthread_create()");
 		if ((r = pthread_create(&threads[1], NULL, thr2, 0)) != 0)
-			err(1, "pthread_create(): %s\n", strerror(r));
+			errc(1, r, "pthread_create()");
 
-		if (pthread_join(threads[0], NULL) != 0)
-			err(1, "pthread_join(%d)", 0);
-		if (pthread_join(threads[1], NULL) != 0)
-			err(1, "pthread_join(%d)", 1);
-		if (pthread_mutex_destroy(&mutex) == -1)
-			err(1, "pthread_mutex_destroy");
-		if (pthread_cond_destroy(&cond) == -1)
-			err(1, "pthread_condattr_destroy");
+		if ((r = pthread_join(threads[0], NULL)) != 0)
+			errc(1, r, "pthread_join(%d)", 0);
+		if ((r = pthread_join(threads[1], NULL)) != 0)
+			errc(1, r, "pthread_join(%d)", 1);
+		if ((r = pthread_mutex_destroy(&mutex)) != 0)
+			errc(1, r, "pthread_mutex_destroy");
+		if ((r = pthread_cond_destroy(&cond)) != 0)
+			errc(1, r, "pthread_cond_destroy)");
 	}
 
 	return (0);

From owner-svn-src-user@freebsd.org  Mon Nov 30 08:51:51 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 19309A3AC36
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:51:51 +0000 (UTC) (envelope-from pho@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 DA7D01139;
 Mon, 30 Nov 2015 08:51:50 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8po3m038378;
 Mon, 30 Nov 2015 08:51:50 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8poWn038377;
 Mon, 30 Nov 2015 08:51:50 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300851.tAU8poWn038377@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:51:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291475 - user/pho/stress2/testcases/fts
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:51:51 -0000

Author: pho
Date: Mon Nov 30 08:51:49 2015
New Revision: 291475
URL: https://svnweb.freebsd.org/changeset/base/291475

Log:
  Trailing white space fix.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/testcases/fts/fts.c

Modified: user/pho/stress2/testcases/fts/fts.c
==============================================================================
--- user/pho/stress2/testcases/fts/fts.c	Mon Nov 30 08:34:19 2015	(r291474)
+++ user/pho/stress2/testcases/fts/fts.c	Mon Nov 30 08:51:49 2015	(r291475)
@@ -61,7 +61,7 @@ test(void)
 	FTS		*fts;
 	FTSENT		*p;
 	int		ftsoptions;
-	char 		*args[2];
+	char		*args[2];
 
 	ftsoptions = FTS_LOGICAL;
 	args[0] = ".";

From owner-svn-src-user@freebsd.org  Mon Nov 30 08:53:19 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 1A1DCA3AD5C
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:53:19 +0000 (UTC) (envelope-from pho@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 D97941363;
 Mon, 30 Nov 2015 08:53:18 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8rHkU041016;
 Mon, 30 Nov 2015 08:53:17 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8rHuo041015;
 Mon, 30 Nov 2015 08:53:17 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300853.tAU8rHuo041015@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:53:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291476 - user/pho/stress2/testcases/run
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:53:19 -0000

Author: pho
Date: Mon Nov 30 08:53:17 2015
New Revision: 291476
URL: https://svnweb.freebsd.org/changeset/base/291476

Log:
  Flush output for use with pipes.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/testcases/run/run.c

Modified: user/pho/stress2/testcases/run/run.c
==============================================================================
--- user/pho/stress2/testcases/run/run.c	Mon Nov 30 08:51:49 2015	(r291475)
+++ user/pho/stress2/testcases/run/run.c	Mon Nov 30 08:53:17 2015	(r291476)
@@ -102,6 +102,7 @@ test(void)
 	tm = localtime(&t);
 	(void) strftime(ct, sizeof(ct), "%T", tm);
 	printf("%s Loop #%d\n", ct, loop++);
+	fflush(stdout);
 
 	for (i = 0; i < op->argc; i++) {
 		if ((r[i] = fork()) == 0) {

From owner-svn-src-user@freebsd.org  Mon Nov 30 08:54:59 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 0DC11A3AD90
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:54:59 +0000 (UTC) (envelope-from pho@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 CCE1014C8;
 Mon, 30 Nov 2015 08:54:58 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8svxH041110;
 Mon, 30 Nov 2015 08:54:57 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8svUE041109;
 Mon, 30 Nov 2015 08:54:57 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300854.tAU8svUE041109@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:54:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291477 - user/pho/stress2/testcases/tcp
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:54:59 -0000

Author: pho
Date: Mon Nov 30 08:54:57 2015
New Revision: 291477
URL: https://svnweb.freebsd.org/changeset/base/291477

Log:
  Make sure inetaddr is zero before use.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/testcases/tcp/tcp.c

Modified: user/pho/stress2/testcases/tcp/tcp.c
==============================================================================
--- user/pho/stress2/testcases/tcp/tcp.c	Mon Nov 30 08:53:17 2015	(r291476)
+++ user/pho/stress2/testcases/tcp/tcp.c	Mon Nov 30 08:54:57 2015	(r291477)
@@ -31,14 +31,14 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <err.h>
+#include <errno.h>
 #include <netdb.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
 #include <string.h>
-#include <err.h>
+#include <unistd.h>
 
 #include "stress.h"
 
@@ -114,6 +114,7 @@ writer(void) {
 			err(1, "setsockopt(), %s:%d", __FILE__, __LINE__);
 
 		hostent = gethostbyname ("localhost");
+		bzero((char *) &inetaddr, sizeof(inetaddr));
 		memcpy (&inetaddr.sin_addr.s_addr, hostent->h_addr,
 			sizeof (struct in_addr));
 

From owner-svn-src-user@freebsd.org  Mon Nov 30 08:57:20 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 D0852A3AE33
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:57:20 +0000 (UTC) (envelope-from pho@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 9CA23163D;
 Mon, 30 Nov 2015 08:57:20 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8vJmJ041250;
 Mon, 30 Nov 2015 08:57:19 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8vJ5i041249;
 Mon, 30 Nov 2015 08:57:19 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300857.tAU8vJ5i041249@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:57:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291478 - user/pho/stress2/testcases/swap
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:57:20 -0000

Author: pho
Date: Mon Nov 30 08:57:19 2015
New Revision: 291478
URL: https://svnweb.freebsd.org/changeset/base/291478

Log:
  Limit load if no swap disk is configured.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/testcases/swap/swap.c

Modified: user/pho/stress2/testcases/swap/swap.c
==============================================================================
--- user/pho/stress2/testcases/swap/swap.c	Mon Nov 30 08:54:57 2015	(r291477)
+++ user/pho/stress2/testcases/swap/swap.c	Mon Nov 30 08:57:19 2015	(r291478)
@@ -72,11 +72,10 @@ setup(int nb)
 			pct = random_int(120, 130);
 
 		if (swapinfo == 0) {
+			pct = random_int(30, 50);
 			if (mem <= MINLEFT)
 				_exit(1);
 			mem -= MINLEFT;
-			if (pct > 100)
-				pct = 100;
 			size = mem / 100 * pct;
 		} else {
 			size = mem / 100 * pct;

From owner-svn-src-user@freebsd.org  Mon Nov 30 09:31:48 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 ABF4AA3CC64
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 09:31:48 +0000 (UTC) (envelope-from pho@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 752C11FA4;
 Mon, 30 Nov 2015 09:31:48 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU9VlL1050689;
 Mon, 30 Nov 2015 09:31:47 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU9VlFl050687;
 Mon, 30 Nov 2015 09:31:47 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300931.tAU9VlFl050687@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 09:31:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291482 - user/pho/stress2/lib
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 09:31:48 -0000

Author: pho
Date: Mon Nov 30 09:31:47 2015
New Revision: 291482
URL: https://svnweb.freebsd.org/changeset/base/291482

Log:
  Fix trailing white space and flush stdout.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/lib/options.c
  user/pho/stress2/lib/resources.c

Modified: user/pho/stress2/lib/options.c
==============================================================================
--- user/pho/stress2/lib/options.c	Mon Nov 30 09:24:12 2015	(r291481)
+++ user/pho/stress2/lib/options.c	Mon Nov 30 09:31:47 2015	(r291482)
@@ -139,7 +139,7 @@ environment(void)
 			usage("INODES");
 	}
 }
-	
+
 void
 options(int argc, char **argv)
 {
@@ -220,6 +220,7 @@ show_status(void)
 		printf("%8s: run time %2d+%s, incarnations %3d, load %3d, verbose %d\n",
 			getprogname(), days, buf, op->incarnations, op->load,
 			op->verbose);
+		fflush(stdout);
 	}
 }
 

Modified: user/pho/stress2/lib/resources.c
==============================================================================
--- user/pho/stress2/lib/resources.c	Mon Nov 30 09:24:12 2015	(r291481)
+++ user/pho/stress2/lib/resources.c	Mon Nov 30 09:31:47 2015	(r291482)
@@ -167,6 +167,9 @@ getdf(int64_t *block, int64_t *inode)
 					O_CREAT | O_TRUNC | O_WRONLY | O_EXCL, 0644)) != -1)
 				break;
 			usleep(10000); /* sleep 1/100 sec */
+			if (i > 0 && i % 1000 == 0)
+				fprintf(stderr, "%s is waiting for lock file %s\n",
+				    getprogname(), lockpath);
 		}
 		if (lockfd != -1)
 			break;
@@ -222,7 +225,7 @@ reservedf(int64_t blks, int64_t inos)
 				getprogname(), blks/1024, inos, blocks/1024, inodes);
 	blocks -= blks;
 	inodes -= inos;
-	
+
 	snprintf(buf, sizeof(buf), "%jd %jd", blocks, inodes);
 	if (blocks < 0 || inodes < 0)
 		printf("******************************** %s: %s\n", getprogname(), buf);

From owner-svn-src-user@freebsd.org  Mon Nov 30 09:38:16 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 6F881A3CDCC
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 09:38:16 +0000 (UTC) (envelope-from pho@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 19F85132B;
 Mon, 30 Nov 2015 09:38:16 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU9cFJ4052883;
 Mon, 30 Nov 2015 09:38:15 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU9cF7J052882;
 Mon, 30 Nov 2015 09:38:15 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300938.tAU9cF7J052882@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 09:38:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291483 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 09:38:16 -0000

Author: pho
Date: Mon Nov 30 09:38:14 2015
New Revision: 291483
URL: https://svnweb.freebsd.org/changeset/base/291483

Log:
  Updated the exclude list.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/all.sh

Modified: user/pho/stress2/misc/all.sh
==============================================================================
--- user/pho/stress2/misc/all.sh	Mon Nov 30 09:31:47 2015	(r291482)
+++ user/pho/stress2/misc/all.sh	Mon Nov 30 09:38:14 2015	(r291483)
@@ -39,8 +39,7 @@
 #		panic: 43 vncache entries remaining			20111220
 # backingstore3.sh
 #		g_vfs_done():md6a[WRITE(offset=...)]error = 28		20111230
-# bio.sh	WiP							20150925
-# core5.sh	May slow down if vnode cache is full			20150714
+# bio.sh	WiP							20151116
 # crossmp4.sh	Known nullfs issue					20150523
 # crossmp6.sh	Known lockd issue					20150625
 # dfull.sh	umount stuck in "mount drain"				20111227
@@ -53,10 +52,10 @@
 # gjournal.sh	kmem_malloc(131072): kmem_map too small			20120626
 # gjournal2.sh
 # gjournal3.sh	panic: Journal overflow					20130729
+# holdcnt03.sh	WiP							20151115
 # lockf5.sh	Page fault						20150622
 # md2.sh	panic: ufs_dirbad: /mnt: bad dir ino ...: mangled entry	20150227
 # maxmemdom.sh	Panic: vm_page_alloc: missing page			20151029
-# maxproc.sh	WiP							20150329
 # memguard.sh	Waiting for fix commit
 # memguard2.sh	Waiting for fix commit
 # memguard3.sh	Waiting for fix commit
@@ -73,7 +72,7 @@
 # quota3.sh	panic: softdep_deallocate_dependencies: unrecovered ...	20111222
 # quota6.sh	panic: softdep_deallocate_dependencies: unrecovered ...	20130206
 # quota7.sh	panic: dqflush: stray dquot				20120221
-# rw.sh		WiP							20150928
+# rw.sh		WiP							20151116
 # shm_open.sh	panic: kmem_malloc(4096): kmem_map too small		20130504
 # snap3.sh	mksnap_ffs stuck in snaprdb				20111226
 # snap5.sh	mksnap_ffs stuck in getblk				20111224
@@ -87,6 +86,7 @@
 # suj18.sh	panic: Bad tailq NEXT(0xc1e2a6088->tqh_last_s) != NULL	20120213
 # suj30.sh	panic: flush_pagedep_deps: MKDIR_PARENT			20121020
 # suj34.sh	Various hangs and panics (SUJ + NULLFS iisue)		20131210
+# swap3.sh	WiP							20151120
 # trim4.sh	Page fault in softdep_count_dependencies+0x27		20140608
 # umountf3.sh	KDB: enter: watchdog timeout				20111217
 # umountf7.sh	panic: handle_written_inodeblock: live inodedep ...	20131129
@@ -191,7 +191,7 @@ grep -wq "$testuser" /etc/passwd ||
 [ -x ../testcases/run/run ] ||
     { echo "Please run \"cd stress2; make\" first." && exit 1; }
 ping -c 2 -t 2 $BLASTHOST > /dev/null 2>&1 ||
-    { echo "Can not ping \$BLASTHOST: $BLASTHOST"; }
+    { echo "Note: Can not ping \$BLASTHOST: $BLASTHOST"; }
 
 rm -f $alllog $alllist
 find `dirname $alllast` -maxdepth 1 -name $alllast -mtime +12h -delete

From owner-svn-src-user@freebsd.org  Mon Nov 30 10:04:14 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@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 A3A16A3C4E3
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 10:04:14 +0000 (UTC) (envelope-from des@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 5B2E71250;
 Mon, 30 Nov 2015 10:04:14 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAUA4DNj061684;
 Mon, 30 Nov 2015 10:04:13 GMT (envelope-from des@FreeBSD.org)
Received: (from des@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAUA4Dpn061683;
 Mon, 30 Nov 2015 10:04:13 GMT (envelope-from des@FreeBSD.org)
Message-Id: <201511301004.tAUA4Dpn061683@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org
 using -f
From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= <des@FreeBSD.org>
Date: Mon, 30 Nov 2015 10:04:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291484 - user/des/compat
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 10:04:14 -0000

Author: des
Date: Mon Nov 30 10:04:13 2015
New Revision: 291484
URL: https://svnweb.freebsd.org/changeset/base/291484

Log:
  Script used to generate tarballs, plists and distinfo for the
  misc/compatNx ports.

Added:
  user/des/compat/
  user/des/compat/mkcompat.sh   (contents, props changed)

Added: user/des/compat/mkcompat.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/des/compat/mkcompat.sh	Mon Nov 30 10:04:13 2015	(r291484)
@@ -0,0 +1,140 @@
+#!/bin/sh
+#-
+# Copyright (c) 2015 Dag-Erling Smørgrav
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+progname=$(basename $(realpath $0))
+today=$(date +'%Y%m%d')
+
+notice() {
+	echo "$@" >&2
+}
+
+error() {
+	echo "$@" >&2
+	exit 1
+}
+
+[ $# -ne 3 ] || error "usage: ${progname} /path/old /path/new"
+
+# Extract version information from old release
+old="$1"
+old_newvers="${old}/usr/src/sys/conf/newvers.sh"
+old_param="${old}/usr/src/sys/sys/param.h"
+[ -f "${old_newvers}" -a -f "${old_param}" ] || \
+    error "missing or incomplete source tree for ${old}"
+eval $(egrep '^(REVISION|BRANCH)=' "${old_newvers}" | tr '\n' ';')
+old_revision="${REVISION}"
+old_major="${REVISION%.*}"
+old_minor="${REVISION#*.}"
+old_branch="${BRANCH}"
+unset REVISION BRANCH
+old_version=$(awk '/^#define __FreeBSD_version/ { print $3 }' "${old_param}")
+case $(file "${old}/sbin/init") in
+*x86-64*)
+	old_arch=amd64
+	;;
+*80386*)
+	old_arch=i386
+	;;
+*)
+	error "${old}: Unreconized architecture"
+	;;
+esac
+notice $old_revision-$old_branch $old_version
+
+# Extract version information from new release
+new="$2"
+new_newvers="${new}/usr/src/sys/conf/newvers.sh"
+new_param="${new}/usr/src/sys/sys/param.h"
+[ -f "${new_newvers}" -a -f "${new_param}" ] || \
+    error "missing or incomplete source tree for ${new}"
+eval $(egrep '^(REVISION|BRANCH)=' "${new_newvers}" | tr '\n' ';')
+new_revision="${REVISION}"
+new_major="${REVISION%.*}"
+new_minor="${REVISION#*.}"
+new_branch="${BRANCH}"
+unset REVISION BRANCH
+new_version=$(awk '/^#define __FreeBSD_version/ { print $3 }' "${new_param}")
+case $(file "${new}/sbin/init") in
+*x86-64*)
+	new_arch=amd64
+	;;
+*80386*)
+	new_arch=i386
+	;;
+*)
+	error "${new}: Unreconized architecture"
+	;;
+esac
+notice $new_revision-$new_branch $new_version
+
+# Sanity check
+if [ "${old_arch}" != "${new_arch}" ] ; then
+    error "${old} (${old_arch}) and ${new} (${new_arch}) mismatch"
+fi
+if [ $((old_major + 1)) -ne $((new_major)) ] ; then
+    error "expecting ${old_revision} and $((old_major + 1)).x or" \
+	  "$((new_major - 1)).x and ${new_revision}, not" \
+	  "${old_revision} and ${new_revision}"
+fi
+
+# Prepare
+portname="compat${old_major}x"
+portversion="${old_revision}.${old_version}.${today}"
+pkgname="${portname}-${old_arch}-${portversion}"
+tarname="${pkgname}.tar.xz"
+mtree="mtree.${old_arch}"
+echo '#mtree' >"${mtree}"
+plist="pkg-plist.${old_arch}"
+:>"${plist}"
+distinfo="distinfo.${old_arch}"
+:>"${distinfo}"
+
+# Search old tree for libraries which do not exist in the new tree
+(cd "${old}" && find -s lib* usr/lib* -type f -name 'lib*.so.*') | \
+    egrep -v '/private/|/lib(lwres|ssh)\.so\.[0-9]+$' | \
+    while read file ; do
+	if [ ! -f "${new}/${file}" ] ; then
+	    lib=$(basename "${file}")
+	    dir=$(basename $(dirname "${file}"))
+	    if [ -f "${pkgname}/${dir}/${lib}" ] ; then
+		error "duplicate library: ${dir}/${lib}"
+	    fi
+	    notice "missing ${dir}/${lib}"
+	    echo "${pkgname}/${dir}/${lib} uid=0 gid=0 mode=0444" \
+		 "type=file content=${old}/${file}" >>"${mtree}"
+	    echo "${dir}/${lib}" >>"${plist}"
+	fi
+    done
+sort "${plist}" >"${plist}-" && mv "${plist}-" "${plist}"
+sort "${mtree}" >"${mtree}-" && mv "${mtree}-" "${mtree}"
+
+# Create tarball and distinfo
+tar -Jcf "${tarname}" @"${mtree}" || exit 1
+echo "SHA256 (${tarname}) = $(sha256 -q ${tarname})" >>"${distinfo}"
+echo "SIZE (${tarname}) = $(stat -f%z ${tarname})" >>"${distinfo}"