summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@FreeBSD.org>2005-08-28 09:05:53 +0000
committerVsevolod Stakhov <vsevolod@FreeBSD.org>2005-08-28 09:05:53 +0000
commit0f17a23c50e7d899046eb1edca8558abab5e90c2 (patch)
tree6544766de6b6f7c39659acfab2efff6269c92abb
parentUpgrade to 1.0.2. (diff)
Add libmicro - a set of portable benchmarks of system calls from
opensolaris project. Approved by: perky (mentor) In collaboration with: gnn
Notes
Notes: svn path=/head/; revision=141057
-rw-r--r--benchmarks/Makefile1
-rw-r--r--benchmarks/libmicro/Makefile46
-rw-r--r--benchmarks/libmicro/distinfo2
-rw-r--r--benchmarks/libmicro/files/extra-patch-ucontext38
-rw-r--r--benchmarks/libmicro/files/patch-Makefile11
-rw-r--r--benchmarks/libmicro/files/patch-Makefile.FreeBSD45
-rw-r--r--benchmarks/libmicro/files/patch-Makefile.com40
-rw-r--r--benchmarks/libmicro/files/patch-bench32
-rw-r--r--benchmarks/libmicro/files/patch-cascade_cond.c36
-rw-r--r--benchmarks/libmicro/files/patch-cascade_mutex.c36
-rw-r--r--benchmarks/libmicro/files/patch-getcontext.c10
-rw-r--r--benchmarks/libmicro/files/patch-getrusage.c10
-rw-r--r--benchmarks/libmicro/files/patch-libmicro.c17
-rw-r--r--benchmarks/libmicro/files/patch-mmpa.c10
-rw-r--r--benchmarks/libmicro/files/patch-msync.c10
-rw-r--r--benchmarks/libmicro/files/patch-multiview39
-rw-r--r--benchmarks/libmicro/files/patch-mutex.c14
-rw-r--r--benchmarks/libmicro/files/patch-setcontext.c10
-rw-r--r--benchmarks/libmicro/files/patch-writev.c20
-rw-r--r--benchmarks/libmicro/pkg-descr7
-rw-r--r--benchmarks/libmicro/pkg-plist166
21 files changed, 600 insertions, 0 deletions
diff --git a/benchmarks/Makefile b/benchmarks/Makefile
index e22d78ba395a..0788bac369c7 100644
--- a/benchmarks/Makefile
+++ b/benchmarks/Makefile
@@ -18,6 +18,7 @@
SUBDIR += iozone
SUBDIR += iozone21
SUBDIR += iperf
+ SUBDIR += libmicro
SUBDIR += lmbench
SUBDIR += nbench
SUBDIR += netio
diff --git a/benchmarks/libmicro/Makefile b/benchmarks/libmicro/Makefile
new file mode 100644
index 000000000000..2726cb9f8efe
--- /dev/null
+++ b/benchmarks/libmicro/Makefile
@@ -0,0 +1,46 @@
+# New ports collection makefile for: libmicro
+# Date created: 2005-08-06
+# Whom: Vsevolod Stakhov <vsevolod@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= libmicro
+PORTVERSION= 0.3.0
+CATEGORIES= benchmarks
+MASTER_SITES= http://opensolaris.org/os/community/performance/libmicro/
+
+MAINTAINER= vsevolod@FreeBSD.org
+COMMENT= Set of utilities to benchmark productivity of system calls
+
+USE_GMAKE= yes
+CFLAGS+= ${PTHREAD_CFLAGS}
+MAKE_ENV= PTHREAD_LIBS=${PTHREAD_LIBS}
+
+WRKSRC= ${WRKDIR}/libMicro-${PORTVERSION}
+PLIST_SUB= ARCH=${ARCH}
+# Do not strip binaries
+STRIP=
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} <= 500036
+EXTRA_PATCHES= ${FILESDIR}/extra-patch-ucontext
+.endif
+
+do-install:
+ ${MKDIR} ${DATADIR}
+ ${MKDIR} ${DATADIR}/bin
+ ${MKDIR} ${DATADIR}/bin-${ARCH}
+ ( cd ${WRKSRC}/bin ; for i in * ; do \
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin-${ARCH}/$$i ${DATADIR}/bin-${ARCH} ; done )
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin-${ARCH}/exec_bin ${DATADIR}/bin-${ARCH}
+ @for i in ${DATADIR}/bin-${ARCH}/* ; do \
+ ${LN} -s $$i ${DATADIR}/bin ; done
+ ${INSTALL_SCRIPT} ${WRKSRC}/bench ${DATADIR}
+ @${ECHO} '#!/bin/sh' > ${WRKDIR}/libmicro-bench
+ @${ECHO} '(cd ${DATADIR} && ./bench $$1)' >> ${WRKDIR}/libmicro-bench
+ ${INSTALL_SCRIPT} ${WRKDIR}/libmicro-bench ${PREFIX}/bin/libmicro-bench
+ ${INSTALL_SCRIPT} ${WRKSRC}/multiview ${PREFIX}/bin/multiview
+
+.include <bsd.port.post.mk>
diff --git a/benchmarks/libmicro/distinfo b/benchmarks/libmicro/distinfo
new file mode 100644
index 000000000000..43501917b739
--- /dev/null
+++ b/benchmarks/libmicro/distinfo
@@ -0,0 +1,2 @@
+MD5 (libmicro-0.3.0.tar.gz) = 3c2ad95bd6e44e4dccae4bb349818038
+SIZE (libmicro-0.3.0.tar.gz) = 49287
diff --git a/benchmarks/libmicro/files/extra-patch-ucontext b/benchmarks/libmicro/files/extra-patch-ucontext
new file mode 100644
index 000000000000..2b2f934f9cde
--- /dev/null
+++ b/benchmarks/libmicro/files/extra-patch-ucontext
@@ -0,0 +1,38 @@
+--- setcontext.c.orig Sat Aug 6 16:18:46 2005
++++ setcontext.c Sat Aug 6 16:19:29 2005
+@@ -57,7 +57,7 @@
+ benchmark(void *tsd, result_t *res)
+ {
+ volatile int i;
+-
++#if 0
+ ucontext_t uc;
+
+ i = 0;
+@@ -68,6 +68,7 @@
+ (void) setcontext(&uc);
+
+ res->re_count += lm_optB;
++#endif
+
+ return (0);
+ }
+--- getcontext.c.orig Sat Aug 6 16:18:39 2005
++++ getcontext.c Sat Aug 6 16:19:06 2005
+@@ -59,7 +59,7 @@
+ benchmark(void *tsd, result_t *res)
+ {
+ int i;
+-
++#if 0
+ for (i = 0; i < lm_optB; i += 10) {
+ ucontext_t uc;
+ (void) getcontext(&uc);
+@@ -74,6 +74,6 @@
+ (void) getcontext(&uc);
+ }
+ res->re_count = i;
+-
++#endif
+ return (0);
+ }
diff --git a/benchmarks/libmicro/files/patch-Makefile b/benchmarks/libmicro/files/patch-Makefile
new file mode 100644
index 000000000000..450e5a1e511a
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig Sat Aug 6 14:07:26 2005
++++ Makefile Sat Aug 6 14:07:43 2005
+@@ -67,7 +67,7 @@
+ wrapper \
+ README
+
+-default $(ALL) run cstyle lint tattle: $(BINS)
++all $(ALL) run cstyle lint tattle: $(BINS)
+ @chmod +x bench multiview
+ @mkdir -p bin-`uname -m`; cd bin-`uname -m`; MACH=`uname -m` $(MAKE) -f ../Makefile.`uname -s` $@
+
diff --git a/benchmarks/libmicro/files/patch-Makefile.FreeBSD b/benchmarks/libmicro/files/patch-Makefile.FreeBSD
new file mode 100644
index 000000000000..a0d1ce593fb6
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-Makefile.FreeBSD
@@ -0,0 +1,45 @@
+--- /dev/null Sat Aug 6 14:00:00 2005
++++ Makefile.FreeBSD Sat Aug 6 14:00:04 2005
+@@ -0,0 +1,42 @@
++#
++# CDDL HEADER START
++#
++# The contents of this file are subject to the terms
++# of the Common Development and Distribution License
++# (the "License"). You may not use this file except
++# in compliance with the License.
++#
++# You can obtain a copy of the license at
++# src/OPENSOLARIS.LICENSE
++# or http://www.opensolaris.org/os/licensing.
++# See the License for the specific language governing
++# permissions and limitations under the License.
++#
++# When distributing Covered Code, include this CDDL
++# HEADER in each file and include the License file at
++# usr/src/OPENSOLARIS.LICENSE. If applicable,
++# add the following below this CDDL HEADER, with the
++# fields enclosed by brackets "[]" replaced with your
++# own identifying information: Portions Copyright [yyyy]
++# [name of copyright owner]
++#
++# CDDL HEADER END
++#
++
++#
++# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
++# Use is subject to license terms.
++#
++# ident "@(#)Makefile.FreeBSD 1.5 05/08/04 SMI"
++#
++
++#CFLAGS= -O -DUSE_SEMOP
++CPPFLAGS= -D_REENTRANT
++MATHLIB= -lm
++
++ELIDED_BENCHMARKS= \
++ cachetocache \
++ atomic
++
++
++include ../Makefile.com
diff --git a/benchmarks/libmicro/files/patch-Makefile.com b/benchmarks/libmicro/files/patch-Makefile.com
new file mode 100644
index 000000000000..7ba3944755e7
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-Makefile.com
@@ -0,0 +1,40 @@
+--- Makefile.com.orig Sat Aug 6 14:02:15 2005
++++ Makefile.com Sat Aug 6 14:05:15 2005
+@@ -44,7 +44,7 @@
+ COMPILER_VERSION_CMD_gcc=gcc -dumpversion
+ COMPILER_VERSION_CMD=$(COMPILER_VERSION_CMD_$(CC))
+
+-default: $(ALL) tattle
++all: $(ALL) tattle
+
+ cstyle:
+ for file in $(ALL:%=../%.c) $(EXTRA_CFILES:%=../%) ; \
+@@ -56,10 +56,10 @@
+
+
+ $(EXTRA_CFILES:%.c=%.lint):
+- $(LINT) ../$(@:%.lint=%.c) -I. -mu -lc libmicro.ln -lm
++ $(LINT) ../$(@:%.lint=%.c) -I. -mu -lc libmicro.ln -lm $(PTHREAD_LIBS)
+
+ %.lint: ../%.c libmicro.ln
+- $(LINT) -mu $(CPPFLAGS) $< libmicro.ln -lpthread -lsocket -lnsl -lm
++ $(LINT) -mu $(CPPFLAGS) $< libmicro.ln -lm $(PTHREAD_LIBS)
+
+ %.o: ../%.c
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+@@ -109,13 +109,13 @@
+ echo "char * compiler_version = \""`$(COMPILER_VERSION_CMD)`"\";" > tattle.h
+ echo "char * CC = \""$(CC)"\";" >> tattle.h
+ echo "char * extra_compiler_flags = \""$(extra_CFLAGS)"\";" >> tattle.h
+- $(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm
++ $(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lm $(PTHREAD_LIBS)
+
+ $(ELIDED_BENCHMARKS): ../elided.c
+ $(CC) -o $(@) ../elided.c
+
+ %: libmicro.a %.o
+- $(CC) -o $(@) $(@).o $($(@)_EXTRA_DEPS) $(CFLAGS) libmicro.a $($(@)_EXTRA_LIBS) $(EXTRA_LIBS) -lpthread -lm
++ $(CC) -o $(@) $(@).o $($(@)_EXTRA_DEPS) $(CFLAGS) libmicro.a $($(@)_EXTRA_LIBS) $(EXTRA_LIBS) -lm $(PTHREAD_LIBS)
+
+ exec: exec_bin
+
diff --git a/benchmarks/libmicro/files/patch-bench b/benchmarks/libmicro/files/patch-bench
new file mode 100644
index 000000000000..71dca3fff1c9
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-bench
@@ -0,0 +1,32 @@
+--- bench.orig Fri Aug 5 06:35:13 2005
++++ bench Tue Aug 9 12:32:52 2005
+@@ -67,7 +67,7 @@
+
+ touch $IFILE
+
+-ARCH=`arch -k`
++ARCH=`uname -m`
+
+ # produce benchmark header for easier comparisons
+
+@@ -85,6 +85,12 @@
+ p_type=`awk -F: '/model name/{print $2; exit}' /proc/cpuinfo`
+ fi
+
++if [ F"`uname -s`" = F"FreeBSD" ] ; then
++ p_count=`sysctl -n hw.ncpu`
++ p_mhz=`sysctl -n hw.clockrate`
++ p_type=`sysctl -n hw.model`
++fi
++
+ printf "!Libmicro_#: %30s\n" $libmicro_version
+ printf "!Options: %30s\n" "$OPTS"
+ printf "!Machine_name: %30s\n" $hostname
+@@ -156,7 +162,6 @@
+ memset $OPTS -N "memset_10k" -s 10k -I 600
+ memset $OPTS -N "memset_1m" -s 1m -I 200000
+ memset $OPTS -N "memset_10m" -s 10m -I 2000000
+-memset $OPTS -N "memsetP2_10m" -s 10m -P 2 -I 2000000
+
+ memrand $OPTS -N "memrand" -s 40m -B 10000
+ cachetocache $OPTS -N "cachetocache" -s 100k -T 2 -I 200
diff --git a/benchmarks/libmicro/files/patch-cascade_cond.c b/benchmarks/libmicro/files/patch-cascade_cond.c
new file mode 100644
index 000000000000..3671c36a7b9a
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-cascade_cond.c
@@ -0,0 +1,36 @@
+--- cascade_cond.c.orig Sat Aug 6 14:12:15 2005
++++ cascade_cond.c Sat Aug 6 14:13:17 2005
+@@ -87,7 +87,6 @@
+
+ (void) sprintf(lm_usage,
+ " [-o] (do signal outside mutex)\n"
+- " [-s] (force PTHREAD_PROCESS_SHARED)\n"
+ "notes: thread cascade using pthread_conds\n");
+
+ return (0);
+@@ -101,9 +100,6 @@
+ case 'o':
+ opto = 1;
+ break;
+- case 's':
+- opts = 1;
+- break;
+ default:
+ return (-1);
+ }
+@@ -152,6 +148,7 @@
+
+ (void) pthread_mutexattr_init(&ma);
+ (void) pthread_condattr_init(&ca);
++#if !defined(__FreeBSD__)
+ if (lm_optP > 1 || opts) {
+ (void) pthread_mutexattr_setpshared(&ma,
+ PTHREAD_PROCESS_SHARED);
+@@ -163,6 +160,7 @@
+ (void) pthread_condattr_setpshared(&ca,
+ PTHREAD_PROCESS_PRIVATE);
+ }
++#endif
+
+ for (i = 0; i < nlocks; i++) {
+ (void) pthread_mutex_init(&mxs[i], &ma);
diff --git a/benchmarks/libmicro/files/patch-cascade_mutex.c b/benchmarks/libmicro/files/patch-cascade_mutex.c
new file mode 100644
index 000000000000..a76c97822fdd
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-cascade_mutex.c
@@ -0,0 +1,36 @@
+--- cascade_mutex.c.orig Sat Aug 6 14:10:03 2005
++++ cascade_mutex.c Sat Aug 6 14:11:53 2005
+@@ -83,7 +83,6 @@
+ lm_defN = "cscd_mutex";
+
+ (void) sprintf(lm_usage,
+- " [-s] (force PTHREAD_PROCESS_SHARED)\n"
+ "notes: thread cascade using pthread_mutexes\n");
+
+ return (0);
+@@ -94,9 +93,6 @@
+ benchmark_optswitch(int opt, char *optarg)
+ {
+ switch (opt) {
+- case 's':
+- opts = 1;
+- break;
+ default:
+ return (-1);
+ }
+@@ -123,6 +119,7 @@
+ }
+
+ (void) pthread_mutexattr_init(&ma);
++#if !defined(__FreeBSD__)
+ if (lm_optP > 1 || opts) {
+ (void) pthread_mutexattr_setpshared(&ma,
+ PTHREAD_PROCESS_SHARED);
+@@ -130,6 +127,7 @@
+ (void) pthread_mutexattr_setpshared(&ma,
+ PTHREAD_PROCESS_PRIVATE);
+ }
++#endif
+
+ for (i = 0; i < nlocks; i++) {
+ (void) pthread_mutex_init(&locks[i], &ma);
diff --git a/benchmarks/libmicro/files/patch-getcontext.c b/benchmarks/libmicro/files/patch-getcontext.c
new file mode 100644
index 000000000000..c5cb8fd88a08
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-getcontext.c
@@ -0,0 +1,10 @@
+--- getcontext.c.orig Sat Aug 6 16:11:21 2005
++++ getcontext.c Sat Aug 6 16:11:45 2005
+@@ -39,6 +39,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <signal.h>
+ #include <ucontext.h>
+
+ #include "libmicro.h"
diff --git a/benchmarks/libmicro/files/patch-getrusage.c b/benchmarks/libmicro/files/patch-getrusage.c
new file mode 100644
index 000000000000..cd3d852eef28
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-getrusage.c
@@ -0,0 +1,10 @@
+--- getrusage.c.orig Sat Aug 6 16:12:36 2005
++++ getrusage.c Sat Aug 6 16:12:57 2005
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <sys/time.h>
+ #include <sys/resource.h>
+
+ #include "libmicro.h"
diff --git a/benchmarks/libmicro/files/patch-libmicro.c b/benchmarks/libmicro/files/patch-libmicro.c
new file mode 100644
index 000000000000..e91108900451
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-libmicro.c
@@ -0,0 +1,17 @@
+--- libmicro.c.orig Sat Aug 6 14:15:04 2005
++++ libmicro.c Sat Aug 6 14:15:52 2005
+@@ -854,10 +854,14 @@
+ b->ba_flag = 0;
+
+ (void) pthread_mutexattr_init(&attr);
++#if !defined(__FreeBSD__)
+ (void) pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
++#endif
+
+ (void) pthread_condattr_init(&cattr);
++#if !defined(__FreeBSD__)
+ (void) pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED);
++#endif
+
+ (void) pthread_mutex_init(&b->ba_lock, &attr);
+ (void) pthread_cond_init(&b->ba_cv, &cattr);
diff --git a/benchmarks/libmicro/files/patch-mmpa.c b/benchmarks/libmicro/files/patch-mmpa.c
new file mode 100644
index 000000000000..f559f94ac2ad
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-mmpa.c
@@ -0,0 +1,10 @@
+--- mmap.c.orig Sat Aug 6 16:13:46 2005
++++ mmap.c Sat Aug 6 16:14:01 2005
+@@ -7,6 +7,7 @@
+ #pragma ident "@(#)mmap.c 1.6 05/08/04 SMI"
+ #endif
+
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include <unistd.h>
+ #include <stdlib.h>
diff --git a/benchmarks/libmicro/files/patch-msync.c b/benchmarks/libmicro/files/patch-msync.c
new file mode 100644
index 000000000000..d4debe66749f
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-msync.c
@@ -0,0 +1,10 @@
+--- msync.c.orig Sat Aug 6 16:14:27 2005
++++ msync.c Sat Aug 6 16:14:45 2005
+@@ -7,6 +7,7 @@
+ #pragma ident "@(#)msync.c 1.1 05/08/04 SMI"
+ #endif
+
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include <unistd.h>
+ #include <stdlib.h>
diff --git a/benchmarks/libmicro/files/patch-multiview b/benchmarks/libmicro/files/patch-multiview
new file mode 100644
index 000000000000..c3d1d13c63e1
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-multiview
@@ -0,0 +1,39 @@
+--- multiview.orig Wed Aug 17 22:48:57 2005
++++ multiview Wed Aug 17 22:49:00 2005
+@@ -40,15 +40,15 @@
+ # the redder the color, the slower the result, the greener the
+ # faster
+
+-/bin/nawk ' BEGIN {
++/usr/bin/awk ' BEGIN {
+ benchmark_count = 0;
+ header_count = 0;
+ }
+ /^#/ {
+- continue;
++ next;
+ }
+ /errors/ {
+- continue;
++ next;
+ }
+ /^\!/ {
+ split($0, A_header, ":");
+@@ -59,7 +59,7 @@
+ header_names[name] = ++header_count;
+ headers[header_count] = name;
+ }
+- continue;
++ next;
+ }
+
+ {
+@@ -128,7 +128,7 @@
+
+ for (j = 2; j < ARGC; j++)
+ printf("<td align=\"right\">%25s</td>\n", "not computed");
+- continue;
++ next;
+ }
+
+ for (j = 2; j < ARGC; j++) {
diff --git a/benchmarks/libmicro/files/patch-mutex.c b/benchmarks/libmicro/files/patch-mutex.c
new file mode 100644
index 000000000000..8ff00c197695
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-mutex.c
@@ -0,0 +1,14 @@
+--- mutex.c.orig Sat Aug 6 14:17:43 2005
++++ mutex.c Sat Aug 6 14:18:26 2005
+@@ -125,9 +125,11 @@
+ errors++;
+ } else {
+ (void) pthread_mutexattr_init(&attr);
++#if !defined(__FreeBSD__)
+ if (optp)
+ (void) pthread_mutexattr_setpshared(&attr,
+ PTHREAD_PROCESS_SHARED);
++#endif
+
+ if (pthread_mutex_init(lock, &attr) != 0)
+ errors++;
diff --git a/benchmarks/libmicro/files/patch-setcontext.c b/benchmarks/libmicro/files/patch-setcontext.c
new file mode 100644
index 000000000000..eaf46be3a8a2
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-setcontext.c
@@ -0,0 +1,10 @@
+--- setcontext.c.orig Sat Aug 6 16:15:12 2005
++++ setcontext.c Sat Aug 6 16:15:31 2005
+@@ -36,6 +36,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <signal.h>
+ #include <ucontext.h>
+
+ #include "libmicro.h"
diff --git a/benchmarks/libmicro/files/patch-writev.c b/benchmarks/libmicro/files/patch-writev.c
new file mode 100644
index 000000000000..5cbfb3af7342
--- /dev/null
+++ b/benchmarks/libmicro/files/patch-writev.c
@@ -0,0 +1,20 @@
+--- writev.c.orig Sat Aug 6 16:16:18 2005
++++ writev.c Sat Aug 6 16:17:00 2005
+@@ -32,12 +32,17 @@
+ #pragma ident "@(#)writev.c 1.7 05/08/04 SMI"
+ #endif
+
++#include <sys/types.h>
+ #include <sys/uio.h>
+ #include <limits.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <fcntl.h>
++
++#ifndef UIO_MAXIOV
++#define UIO_MAXIOV 1024
++#endif
+
+ #ifndef IOV_MAX
+ #define IOV_MAX UIO_MAXIOV
diff --git a/benchmarks/libmicro/pkg-descr b/benchmarks/libmicro/pkg-descr
new file mode 100644
index 000000000000..97ca92df0581
--- /dev/null
+++ b/benchmarks/libmicro/pkg-descr
@@ -0,0 +1,7 @@
+LibMicro is a portable set of microbenchmarks that many Solaris engineers used
+during Solaris 10 development to measure the performance of various system and
+library calls. LibMicro was developed by Bart Smaalders and Phil Harman as part
+of their If another OS is faster it's a Solaris bug performance campaign.
+LibMicro is being released as Open Source under the CDDL license.
+
+WWW: http://opensolaris.org/os/community/performance/libmicro/
diff --git a/benchmarks/libmicro/pkg-plist b/benchmarks/libmicro/pkg-plist
new file mode 100644
index 000000000000..9ae109ce4607
--- /dev/null
+++ b/benchmarks/libmicro/pkg-plist
@@ -0,0 +1,166 @@
+bin/libmicro-bench
+bin/multiview
+%%DATADIR%%/bench
+%%DATADIR%%/bin-%%ARCH%%/atomic
+%%DATADIR%%/bin-%%ARCH%%/bind
+%%DATADIR%%/bin-%%ARCH%%/cachetocache
+%%DATADIR%%/bin-%%ARCH%%/cascade_cond
+%%DATADIR%%/bin-%%ARCH%%/cascade_fcntl
+%%DATADIR%%/bin-%%ARCH%%/cascade_flock
+%%DATADIR%%/bin-%%ARCH%%/cascade_lockf
+%%DATADIR%%/bin-%%ARCH%%/cascade_mutex
+%%DATADIR%%/bin-%%ARCH%%/chdir
+%%DATADIR%%/bin-%%ARCH%%/close
+%%DATADIR%%/bin-%%ARCH%%/close_tcp
+%%DATADIR%%/bin-%%ARCH%%/connection
+%%DATADIR%%/bin-%%ARCH%%/dup
+%%DATADIR%%/bin-%%ARCH%%/exec
+%%DATADIR%%/bin-%%ARCH%%/exec_bin
+%%DATADIR%%/bin-%%ARCH%%/exit
+%%DATADIR%%/bin-%%ARCH%%/exp
+%%DATADIR%%/bin-%%ARCH%%/fcntl
+%%DATADIR%%/bin-%%ARCH%%/fcntl_ndelay
+%%DATADIR%%/bin-%%ARCH%%/file_lock
+%%DATADIR%%/bin-%%ARCH%%/fork
+%%DATADIR%%/bin-%%ARCH%%/getcontext
+%%DATADIR%%/bin-%%ARCH%%/getenv
+%%DATADIR%%/bin-%%ARCH%%/getpeername
+%%DATADIR%%/bin-%%ARCH%%/getpid
+%%DATADIR%%/bin-%%ARCH%%/getrusage
+%%DATADIR%%/bin-%%ARCH%%/getsockname
+%%DATADIR%%/bin-%%ARCH%%/gettimeofday
+%%DATADIR%%/bin-%%ARCH%%/isatty
+%%DATADIR%%/bin-%%ARCH%%/listen
+%%DATADIR%%/bin-%%ARCH%%/localtime_r
+%%DATADIR%%/bin-%%ARCH%%/log
+%%DATADIR%%/bin-%%ARCH%%/longjmp
+%%DATADIR%%/bin-%%ARCH%%/lrand48
+%%DATADIR%%/bin-%%ARCH%%/lseek
+%%DATADIR%%/bin-%%ARCH%%/malloc
+%%DATADIR%%/bin-%%ARCH%%/memcpy
+%%DATADIR%%/bin-%%ARCH%%/memmove
+%%DATADIR%%/bin-%%ARCH%%/memrand
+%%DATADIR%%/bin-%%ARCH%%/memset
+%%DATADIR%%/bin-%%ARCH%%/mktime
+%%DATADIR%%/bin-%%ARCH%%/mmap
+%%DATADIR%%/bin-%%ARCH%%/mprotect
+%%DATADIR%%/bin-%%ARCH%%/msync
+%%DATADIR%%/bin-%%ARCH%%/munmap
+%%DATADIR%%/bin-%%ARCH%%/mutex
+%%DATADIR%%/bin-%%ARCH%%/nop
+%%DATADIR%%/bin-%%ARCH%%/open
+%%DATADIR%%/bin-%%ARCH%%/pipe
+%%DATADIR%%/bin-%%ARCH%%/poll
+%%DATADIR%%/bin-%%ARCH%%/pread
+%%DATADIR%%/bin-%%ARCH%%/pthread_create
+%%DATADIR%%/bin-%%ARCH%%/pwrite
+%%DATADIR%%/bin-%%ARCH%%/read
+%%DATADIR%%/bin-%%ARCH%%/realpath
+%%DATADIR%%/bin-%%ARCH%%/recurse
+%%DATADIR%%/bin-%%ARCH%%/select
+%%DATADIR%%/bin-%%ARCH%%/semop
+%%DATADIR%%/bin-%%ARCH%%/setcontext
+%%DATADIR%%/bin-%%ARCH%%/setsockopt
+%%DATADIR%%/bin-%%ARCH%%/sigaction
+%%DATADIR%%/bin-%%ARCH%%/siglongjmp
+%%DATADIR%%/bin-%%ARCH%%/signal
+%%DATADIR%%/bin-%%ARCH%%/sigprocmask
+%%DATADIR%%/bin-%%ARCH%%/socket
+%%DATADIR%%/bin-%%ARCH%%/socketpair
+%%DATADIR%%/bin-%%ARCH%%/stat
+%%DATADIR%%/bin-%%ARCH%%/strcasecmp
+%%DATADIR%%/bin-%%ARCH%%/strchr
+%%DATADIR%%/bin-%%ARCH%%/strcmp
+%%DATADIR%%/bin-%%ARCH%%/strcpy
+%%DATADIR%%/bin-%%ARCH%%/strftime
+%%DATADIR%%/bin-%%ARCH%%/strlen
+%%DATADIR%%/bin-%%ARCH%%/strtol
+%%DATADIR%%/bin-%%ARCH%%/system
+%%DATADIR%%/bin-%%ARCH%%/tattle
+%%DATADIR%%/bin-%%ARCH%%/time
+%%DATADIR%%/bin-%%ARCH%%/times
+%%DATADIR%%/bin-%%ARCH%%/write
+%%DATADIR%%/bin-%%ARCH%%/writev
+%%DATADIR%%/bin/atomic
+%%DATADIR%%/bin/bind
+%%DATADIR%%/bin/cachetocache
+%%DATADIR%%/bin/cascade_cond
+%%DATADIR%%/bin/cascade_fcntl
+%%DATADIR%%/bin/cascade_flock
+%%DATADIR%%/bin/cascade_lockf
+%%DATADIR%%/bin/cascade_mutex
+%%DATADIR%%/bin/chdir
+%%DATADIR%%/bin/close
+%%DATADIR%%/bin/close_tcp
+%%DATADIR%%/bin/connection
+%%DATADIR%%/bin/dup
+%%DATADIR%%/bin/exec
+%%DATADIR%%/bin/exec_bin
+%%DATADIR%%/bin/exit
+%%DATADIR%%/bin/exp
+%%DATADIR%%/bin/fcntl
+%%DATADIR%%/bin/fcntl_ndelay
+%%DATADIR%%/bin/file_lock
+%%DATADIR%%/bin/fork
+%%DATADIR%%/bin/getcontext
+%%DATADIR%%/bin/getenv
+%%DATADIR%%/bin/getpeername
+%%DATADIR%%/bin/getpid
+%%DATADIR%%/bin/getrusage
+%%DATADIR%%/bin/getsockname
+%%DATADIR%%/bin/gettimeofday
+%%DATADIR%%/bin/isatty
+%%DATADIR%%/bin/listen
+%%DATADIR%%/bin/localtime_r
+%%DATADIR%%/bin/log
+%%DATADIR%%/bin/longjmp
+%%DATADIR%%/bin/lrand48
+%%DATADIR%%/bin/lseek
+%%DATADIR%%/bin/malloc
+%%DATADIR%%/bin/memcpy
+%%DATADIR%%/bin/memmove
+%%DATADIR%%/bin/memrand
+%%DATADIR%%/bin/memset
+%%DATADIR%%/bin/mktime
+%%DATADIR%%/bin/mmap
+%%DATADIR%%/bin/mprotect
+%%DATADIR%%/bin/msync
+%%DATADIR%%/bin/munmap
+%%DATADIR%%/bin/mutex
+%%DATADIR%%/bin/nop
+%%DATADIR%%/bin/open
+%%DATADIR%%/bin/pipe
+%%DATADIR%%/bin/poll
+%%DATADIR%%/bin/pread
+%%DATADIR%%/bin/pthread_create
+%%DATADIR%%/bin/pwrite
+%%DATADIR%%/bin/read
+%%DATADIR%%/bin/realpath
+%%DATADIR%%/bin/recurse
+%%DATADIR%%/bin/select
+%%DATADIR%%/bin/semop
+%%DATADIR%%/bin/setcontext
+%%DATADIR%%/bin/setsockopt
+%%DATADIR%%/bin/sigaction
+%%DATADIR%%/bin/siglongjmp
+%%DATADIR%%/bin/signal
+%%DATADIR%%/bin/sigprocmask
+%%DATADIR%%/bin/socket
+%%DATADIR%%/bin/socketpair
+%%DATADIR%%/bin/stat
+%%DATADIR%%/bin/strcasecmp
+%%DATADIR%%/bin/strchr
+%%DATADIR%%/bin/strcmp
+%%DATADIR%%/bin/strcpy
+%%DATADIR%%/bin/strftime
+%%DATADIR%%/bin/strlen
+%%DATADIR%%/bin/strtol
+%%DATADIR%%/bin/system
+%%DATADIR%%/bin/tattle
+%%DATADIR%%/bin/time
+%%DATADIR%%/bin/times
+%%DATADIR%%/bin/write
+%%DATADIR%%/bin/writev
+@dirrm %%DATADIR%%/bin-%%ARCH%%
+@dirrm %%DATADIR%%/bin
+@dirrm %%DATADIR%%