Add work in progress libmicro recipe for tqh to play with

This commit is contained in:
Chris Roberts
2014-01-26 12:13:49 -07:00
parent 176cac1066
commit 91e14adc14
2 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
SUMMARY="libmicro - portable microbenchmarks"
DESCRIPTION="
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 Linux
is faster it's a Solaris bug performance campaign. LibMicro is Open
Source and uses the CDDL license.The libMicro sources include an awk
script that generates color coded html pages to easily compare
various OS revs, processors and other differences in a quick manner
"
LICENSE="CDDL v1"
COPYRIGHT="2013 Oracle"
HOMEPAGE="https://java.net/projects/libmicro"
SRC_URI="hg+https://hg.java.net/hg/libmicro~hg-repo#7dd95b416c3c"
REVISION="1"
ARCHITECTURES="!x86 !x86_gcc2"
PROVIDES="
libmicro = $portVersion
"
REQUIRES="
haiku >= $haikuVersion
"
BUILD_REQUIRES="
haiku_devel >= $haikuVersion
"
BUILD_PREREQUIRES="
cmd:make
cmd:gcc
"
PATCHES="libmicro-0.4.2.patchset"
BUILD()
{
make
}
INSTALL()
{
make install
}

View File

@@ -0,0 +1,139 @@
From 4beb46cb703e13ca5b6a055efec5f18c961b11fe Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 26 Jan 2014 11:57:02 -0700
Subject: applying patch libmicro-0.4.1.patch
diff --git a/Makefile.Haiku b/Makefile.Haiku
new file mode 100644
index 0000000..5181d91
--- /dev/null
+++ b/Makefile.Haiku
@@ -0,0 +1,43 @@
+#
+# 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.
+#
+
+
+CC= gcc
+
+#CFLAGS= -O -DUSE_SEMOP
+CPPFLAGS= -DUSE_SEMOP -D_REENTRANT
+MATHLIB=
+
+ELIDED_BENCHMARKS= \
+ cachetocache \
+ atomic
+
+
+include ../Makefile.com
diff --git a/Makefile.benchmarks b/Makefile.benchmarks
index ed1923a..d1b1ff8 100644
--- a/Makefile.benchmarks
+++ b/Makefile.benchmarks
@@ -50,7 +50,7 @@ ALL= \
fcntl_ndelay \
file_lock \
fork \
- getcontext \
+# getcontext \
getenv \
gettimeofday \
getpeername \
diff --git a/Makefile.com b/Makefile.com
index 2ba7e76..5773900 100644
--- a/Makefile.com
+++ b/Makefile.com
@@ -54,10 +54,10 @@ lint: libmicro.ln $(ALL:%=%.lint) $(EXTRA_CFILES:%.c=%.lint)
$(EXTRA_CFILES:%.c=%.lint):
- $(LINT) ../$(@:%.lint=%.c) -I. -mu -lc libmicro.ln -lm
+ $(LINT) ../$(@:%.lint=%.c) -I. -mu -lc libmicro.ln
%.lint: ../%.c libmicro.ln
- $(LINT) -mu $(CPPFLAGS) $< libmicro.ln -lpthread -lsocket -lnsl -lm
+ $(LINT) -mu $(CPPFLAGS) $< libmicro.ln -lnetwork
%.o: ../%.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
@@ -107,13 +107,13 @@ tattle: ../tattle.c libmicro.a
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
$(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) -lnetwork
exec: exec_bin
diff --git a/bench.sh b/bench.sh
index 4795c10..24ca1d9 100644
--- a/bench.sh
+++ b/bench.sh
@@ -56,7 +56,7 @@ VDIR1=$VARROOT/0/1/2/3/4/5/6/7/8/9
VDIR2=$VARROOT/1/2/3/4/5/6/7/8/9/0
-OPTS="-E -C 200 -L -S -W"
+OPTS="-l -E -C 200 -L -S -W"
dd if=/dev/zero of=$TFILE bs=1024k count=10 2>/dev/null
dd if=/dev/zero of=$VFILE bs=1024k count=10 2>/dev/null
@@ -65,7 +65,7 @@ mkdir -p $VDIR1 $VDIR2
touch $IFILE
-ARCH=`arch -k`
+ARCH=`uname -m`
# produce benchmark header for easier comparisons
diff --git a/cascade_flock.c b/cascade_flock.c
index 27d95d1..a6634a1 100644
--- a/cascade_flock.c
+++ b/cascade_flock.c
@@ -50,7 +50,7 @@
#include "libmicro.h"
#ifndef LOCK_EX
-#include "/usr/ucbinclude/sys/file.h"
+#include "sys/file.h"
extern int flock(int fd, int operation);
#endif
--
1.8.3.4