From nobody@FreeBSD.org  Thu Feb 16 07:26:44 2012
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 BEE5D106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 07:26:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A88C88FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 07:26:44 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G7QiTR043043
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2012 07:26:44 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1G7QihO043042;
	Thu, 16 Feb 2012 07:26:44 GMT
	(envelope-from nobody)
Message-Id: <201202160726.q1G7QihO043042@red.freebsd.org>
Date: Thu, 16 Feb 2012 07:26:44 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] benchmarks/xdd: fix CPU detection slew of string.h compile time warnings
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: g.gonter@ieee.org

>Number:         165197
>Category:       ports
>Synopsis:       [patch] benchmarks/xdd: fix CPU detection slew of string.h compile time warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    scheidell
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 16 07:30:11 UTC 2012
>Closed-Date:    Sun Apr 15 11:43:30 UTC 2012
>Last-Modified:  Sun Feb 03 22:30:25 UTC 2013
>Originator:     Garrett Cooper
>Release:        9.0-STABLE
>Organization:
iXsystems, Inc.
>Environment:
FreeBSD bayonetta.local 9.0-STABLE FreeBSD 9.0-STABLE #4 r230371M: Thu Jan 19 23:55:38 PST 2012     gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
>Description:
The attached patch enhances xdd to detect the number of CPUs in a system (according to the semi-POSIX definition), and also fixes a slew of compile time warnings with string.h not being included in xdd.h.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -Naur benchmarks/xdd/Makefile benchmarks/xdd/Makefile
--- benchmarks/xdd/Makefile	2007-12-21 07:31:17.000000000 -0800
+++ benchmarks/xdd/Makefile	2012-02-15 22:22:20.394135532 -0800
@@ -7,6 +7,7 @@
 
 PORTNAME=	xdd
 PORTVERSION=	65
+PORTREVISION=	1
 CATEGORIES=	benchmarks
 MASTER_SITES=	http://www.ioperformance.com/xddversions/
 DISTNAME=	xdd65.013007
diff -Naur benchmarks/xdd/files/patch-initialization.c benchmarks/xdd/files/patch-initialization.c
--- benchmarks/xdd/files/patch-initialization.c	2007-12-21 07:25:47.000000000 -0800
+++ benchmarks/xdd/files/patch-initialization.c	2012-02-15 21:59:31.220136804 -0800
@@ -1,6 +1,19 @@
---- initialization.c.orig	Fri Mar 16 06:54:36 2007
-+++ initialization.c	Fri Mar 16 06:56:05 2007
-@@ -628,7 +628,7 @@
+--- initialization.c.orig	2012-02-09 19:46:52.785072682 -0800
++++ initialization.c	2012-02-15 21:58:34.759136156 -0800
+@@ -181,11 +181,7 @@
+ 	fprintf(out, "Computer Name, %s, User Name, %s\n",name.nodename, getlogin());
+ 	fprintf(out, "OS release and version, %s %s %s\n",name.sysname, name.release, name.version);
+ 	fprintf(out, "Machine hardware type, %s\n",name.machine);
+-#if (SOLARIS)
+-	xgp->number_of_processors = sysconf(_SC_NPROCESSORS_ONLN);
+-	physical_pages = sysconf(_SC_PHYS_PAGES);
+-	page_size = sysconf(_SC_PAGE_SIZE);
+-#elif (AIX)
++#if (SOLARIS || AIX || FreeBSD)
+ 	xgp->number_of_processors = sysconf(_SC_NPROCESSORS_ONLN);
+ 	physical_pages = sysconf(_SC_PHYS_PAGES);
+ 	page_size = sysconf(_SC_PAGE_SIZE);
+@@ -628,7 +624,7 @@
  	 * NOTE: This is not supported by all operating systems. 
  	 */
  	if (p->target_options & RX_SHARED_MEMORY) {
@@ -9,7 +22,7 @@
  		/* In AIX we need to get memory in a shared memory segment to avoid
  	     * the system continually trying to pin each page on every I/O operation */
  #if (AIX)
-@@ -656,14 +656,14 @@
+@@ -656,14 +652,14 @@
  		fprintf(xgp->errout,"%s: Shared Memory not supported on this OS - using valloc\n",
  			xgp->progname);
  		p->target_options &= ~RX_SHARED_MEMORY;
@@ -26,7 +39,7 @@
  		rwbuf = valloc(p->iosize);
  #else
  		rwbuf = malloc(p->iosize);
-@@ -740,7 +740,7 @@
+@@ -740,7 +736,7 @@
  	newlim = liret - (PAGESIZE*8);
  	return;
  #else
@@ -35,7 +48,7 @@
  	if (getuid() != 0) {
  		fprintf(xgp->errout,"(PID %d) %s: You must run as superuser to lock memory for %s\n",
  			getpid(),xgp->progname, sp);
-@@ -889,7 +889,7 @@
+@@ -889,7 +885,7 @@
  #endif
  	return;
  #else
@@ -44,7 +57,7 @@
  	if (getuid() != 0) {
  		return;
  	}
-@@ -974,7 +974,7 @@
+@@ -974,7 +970,7 @@
  	if (xgp->global_options & RX_NOPROCLOCK) 
                  return;
  #if !(OSX)
@@ -53,7 +66,7 @@
  	if (getuid() != 0)
  		fprintf(xgp->errout,"%s: xdd_schedule_options: You must be super user to lock processes\n",xgp->progname);
  #endif 
-@@ -985,7 +985,7 @@
+@@ -985,7 +981,7 @@
  		perror("Reason");
  	}
  	if (xgp->global_options & RX_MAXPRI) {
@@ -62,7 +75,7 @@
  		if (getuid() != 0) 
  			fprintf(xgp->errout,"%s: xdd_schedule_options: You must be super user to max priority\n",xgp->progname);
  #endif
-@@ -1127,7 +1127,7 @@
+@@ -1127,7 +1123,7 @@
  #endif
  #if (IRIX || SOLARIS || HPUX || AIX || ALTIX)
  	struct stat64 statbuf; /* buffer for file statistics */
diff -Naur benchmarks/xdd/files/patch-parse.c benchmarks/xdd/files/patch-parse.c
--- benchmarks/xdd/files/patch-parse.c	2007-12-21 07:25:47.000000000 -0800
+++ benchmarks/xdd/files/patch-parse.c	2012-02-15 22:19:47.555136372 -0800
@@ -1,5 +1,5 @@
---- parse.c.orig	Fri Mar 16 07:10:44 2007
-+++ parse.c	Fri Mar 16 07:11:44 2007
+--- parse.c.orig	2012-02-15 22:02:57.832134671 -0800
++++ parse.c	2012-02-15 22:02:57.878141191 -0800
 @@ -810,7 +810,7 @@
  xddfunc_delay(int32_t argc, char *argv[])
  { 
@@ -18,3 +18,30 @@
  }
  /*----------------------------------------------------------------------------*/
  // Set the maximum runtime priority
+@@ -1448,7 +1448,7 @@
+ #if (LINUXUP || HPUX || OSX)
+ 	cpus = 1;
+ 	fprintf(xgp->errout,"%s: WARNING: Multiple processors not supported in this release\n",xgp->progname);
+-#elif (SOLARIS || AIX)
++#elif (SOLARIS || AIX || FreeBSD)
+ 	/* SOLARIS or AIX */ 
+ 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ #elif (IRIX || WIN32)
+@@ -1764,7 +1764,7 @@
+ #if (LINUXUP || HPUX || OSX)
+ 	cpus = 1;
+ 	fprintf(xgp->errout,"%s: WARNING: Multiple processors not supported in this release\n",xgp->progname);
+-#elif (SOLARIS || AIX)
++#elif (SOLARIS || AIX || FreeBSD)
+ 	/* SOLARIS or AIX */ 
+ 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ #elif (IRIX || WIN32)
+@@ -2057,7 +2057,7 @@
+ #if (LINUXUP || HPUX || OSX)
+ 	cpus = 1;
+ 	fprintf(xgp->errout,"%s: WARNING: Multiple processors not supported in this release\n",xgp->progname);
+-#elif (SOLARIS || AIX)
++#elif (SOLARIS || AIX || FreeBSD)
+ 	/* SOLARIS or AIX */ 
+ 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ #elif (IRIX || WIN32)
diff -Naur benchmarks/xdd/files/patch-xdd.h benchmarks/xdd/files/patch-xdd.h
--- benchmarks/xdd/files/patch-xdd.h	2007-12-21 07:25:47.000000000 -0800
+++ benchmarks/xdd/files/patch-xdd.h	2012-02-15 22:01:19.438135496 -0800
@@ -1,5 +1,19 @@
---- xdd.h.orig	Fri Mar 16 06:35:11 2007
-+++ xdd.h	Fri Mar 16 07:04:35 2007
+--- xdd.h.orig	2012-02-15 22:00:06.595144141 -0800
++++ xdd.h	2012-02-15 22:01:01.868152911 -0800
+@@ -30,12 +30,12 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
++#include <string.h>
+ #ifdef WIN32
+ #include <io.h>
+ #include <sys/timeb.h>
+ #include <time.h>
+ #include <memory.h>
+-#include <string.h>
+ #include <windows.h>
+ #include <windef.h>
+ #include <winbase.h>
 @@ -48,7 +48,7 @@
  #include <sys/ipc.h>
  #include <sys/sem.h>


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Feb 16 07:30:23 UTC 2012 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: g.gonter@ieee.org
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/165197: [patch] benchmarks/xdd: fix CPU detection slew of string.h compile time warnings
Date: Thu, 16 Feb 2012 07:30:19 UT

 Maintainer of benchmarks/xdd,
 
 Please note that PR ports/165197 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/165197
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-ports-bugs->scheidell 
Responsible-Changed-By: scheidell 
Responsible-Changed-When: Sun Apr 15 11:28:34 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165197 
State-Changed-From-To: feedback->closed 
State-Changed-By: scheidell 
State-Changed-When: Sun Apr 15 11:43:29 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

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

From: Michael Scheidell <scheidell@FreeBSD.org>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: ports/165197: [patch] benchmarks/xdd: fix CPU detection slew
 of string.h compile time warnings
Date: Sun, 15 Apr 2012 07:40:48 -0400

 maintainer:
 
 We appreciate your time and efforts in helping with FreeBSD ports and 
 porting.
 
 submitters patch applies just fine, package builds in tinderbox in 
 7-I386 - 9-AMD.
 This pr has been opened for two months.  If you are not able to maintain 
 benchmarks/xdd anymore, please let us know.
 
 -- 
 Michael Scheidell, CTO
  >*| * SECNAP Network Security Corporation
 d: +1.561.948.2259
 w: http://people.freebsd.org/~scheidell

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/165197: commit references a PR
Date: Sun, 15 Apr 2012 11:43:27 +0000 (UTC)

 scheidell    2012-04-15 11:43:13 UTC
 
   FreeBSD ports repository
 
   Modified files:
     benchmarks/xdd       Makefile 
     benchmarks/xdd/files patch-initialization.c patch-parse.c 
                          patch-xdd.h 
   Log:
   - Enhances detection of CPU count
   - fixes compile time warnings with string.hg not being included in xdd.h
   
   PR:             ports/165197
   Submitted by:   Garrett Cooper <yaneurabeya@gmail.com>
   Approved by:    g.gonter@ieee.org (maintainer, timeout 60 days)
   
   Revision  Changes    Path
   1.6       +1 -0      ports/benchmarks/xdd/Makefile
   1.4       +22 -9     ports/benchmarks/xdd/files/patch-initialization.c
   1.4       +29 -2     ports/benchmarks/xdd/files/patch-parse.c
   1.4       +16 -2     ports/benchmarks/xdd/files/patch-xdd.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
