Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

9
benchmarks/hbench/DESCR Normal file
View File

@@ -0,0 +1,9 @@
HBench-OS is a suite of portable benchmarks designed to measure the
performance of primitive functionality provided by an operating
system/hardware platform. HBench-OS was designed primarily as a
research tool for the systems research and OS development communities,
and thus its major design goal is to provide a flexible system for
reproducible, accurate, and statistically-sound performance analysis
and evaluation. These characteristics make it ideal for both
performance research as well as more traditional consumer-oriented
performance measurement and analysis.

View File

@@ -0,0 +1,8 @@
===========================================================================
$NetBSD: MESSAGE,v 1.2 2002/09/12 17:07:51 wiz Exp $
Execute "run-hbench" to run the benchmark.
There is a Makefile in the ${PREFIX}/share/hbench/Results directory
that can be used to format and summarize your results as well.
===========================================================================

View File

@@ -0,0 +1,78 @@
# $NetBSD: Makefile,v 1.51 2013/05/31 12:39:38 wiz Exp $
DISTNAME= hbench-OS-1.1
PKGNAME= hbench-1.1
PKGREVISION= 3
CATEGORIES= benchmarks
MASTER_SITES= http://www.eecs.harvard.edu/vino/perf/hbench/
PATCHFILES= hbench-OS-1.1-provisional-patch1.diff
PATCH_SITES= http://www.eecs.harvard.edu/~dholland/netbsd/
PATCH_DIST_STRIP= -p1
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.eecs.harvard.edu/vino/perf/hbench/
COMMENT= Suite of portable benchmarks to measure the OS and the hardware
DEPENDS+= gnuplot>=3.7:../../graphics/gnuplot
PKG_INSTALLATION_TYPES= overwrite pkgviews
WRKSRC= ${WRKDIR}/HBenchOS
OSVERSION_SPECIFIC= YES
BUILD_TARGET= build
USE_TOOLS+= perl:run
OVERRIDE_GNU_CONFIG_SCRIPTS= yes
MAKE_JOBS_SAFE= no
GET_ARCH_CMD= ${PKGSRCDIR:Q}/mk/gnu-config/config.guess | ${SED} -e 's/-.*-.*$$//'
GET_OS_CMD= ${PKGSRCDIR:Q}/mk/gnu-config/config.guess | ${SED} -e 's/^[^-]*-[^-]*-//;s/-.*$$//'
PLIST_SUBST+= PLATFORM=${GET_OS_CMD:sh:Q}-${GET_ARCH_CMD:sh:Q}
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "SunOS"
BUILDLINK_TRANSFORM+= rm:-static
.endif
HB_HOSTNAME!= ${UNAME} -n
HB_SHORTNAME= ${HB_HOSTNAME:C/\..*//}
post-extract:
${CP} ${FILESDIR}/do-install ${WRKSRC}
SUBST_CLASSES+= hb
SUBST_STAGE.hb= pre-configure
SUBST_MESSAGE.hb= Replacing bin with libexec.
SUBST_FILES.hb= do-install
SUBST_FILES.hb+= scripts/*
SUBST_FILES.hb+= Results/Makefile
SUBST_SED.hb= -e 's,@PREFIX@,${PREFIX},g'
SUBST_SED.hb+= -e 's,/bin/hbench,/libexec/hbench,g'
INSTALLATION_DIRS= bin
do-install:
${SETENV} ${MAKE_ENV} WRKSRC=${WRKSRC} BINOWN=${BINOWN} \
REAL_PREFIX=${PREFIX} BINGRP=${BINGRP} \
PREFIX=${DESTDIR}${PREFIX} ${WRKSRC}/do-install
benchmark:
@if [ `id -u` != 0 ]; then ${ECHO} "This benchmark must be run as root!" ; exit 1 ; fi
cd ${WRKSRC}; \
${MKDIR} conf; \
${MKDIR} results; \
${SED} -e 's|@pwd@|'`/bin/pwd`'|g' \
-e 's|@hostname@|${HB_SHORTNAME}|g' \
-e 's|@wrksrc@|'`/bin/pwd`'|g' \
${FILESDIR}/setup.answers | ${MAKE} setup; \
${MV} conf/${HB_SHORTNAME}.run conf/foo ; \
${SED} -e 's|#PLAINBINDIR=${HBENCHROOT}|PLAINBINDIR='`/bin/pwd`'|' \
< conf/foo > conf/${HB_SHORTNAME}.run ; \
${MAKE} run
results:
@${MKDIR} /tmp/benches/`domainname`
-@cd ${WRKSRC} ; \
tar -cf /tmp/benches/`domainname`/hbench.`uname`-`uname -m`-`uname -r`.`hostname`.tar results conf
.include "../../mk/bsd.pkg.mk"

View File

@@ -0,0 +1,51 @@
@comment $NetBSD: PLIST.common,v 1.4 2006/06/18 10:07:09 rillig Exp $
bin/run-hbench
libexec/hbench/${PLATFORM}/bw_bzero
libexec/hbench/${PLATFORM}/bw_file_rd
libexec/hbench/${PLATFORM}/bw_mem_cp
libexec/hbench/${PLATFORM}/bw_mem_rd
libexec/hbench/${PLATFORM}/bw_mem_wr
libexec/hbench/${PLATFORM}/bw_mmap_rd
libexec/hbench/${PLATFORM}/bw_pipe
libexec/hbench/${PLATFORM}/bw_tcp
libexec/hbench/${PLATFORM}/hello
libexec/hbench/${PLATFORM}/hello-s
libexec/hbench/${PLATFORM}/lat_connect
libexec/hbench/${PLATFORM}/lat_ctx
libexec/hbench/${PLATFORM}/lat_ctx2
libexec/hbench/${PLATFORM}/lat_fs
libexec/hbench/${PLATFORM}/lat_fslayer
libexec/hbench/${PLATFORM}/lat_mem_rd
libexec/hbench/${PLATFORM}/lat_mmap
libexec/hbench/${PLATFORM}/lat_pipe
libexec/hbench/${PLATFORM}/lat_proc
libexec/hbench/${PLATFORM}/lat_rpc
libexec/hbench/${PLATFORM}/lat_sig
libexec/hbench/${PLATFORM}/lat_syscall
libexec/hbench/${PLATFORM}/lat_tcp
libexec/hbench/${PLATFORM}/lat_udp
libexec/hbench/${PLATFORM}/memsize
libexec/hbench/${PLATFORM}/mhz
libexec/hbench/argsort
libexec/hbench/config.guess
libexec/hbench/config.sub
libexec/hbench/create-all-analyses
libexec/hbench/create-all-latgraphs
libexec/hbench/create-all-summaries
libexec/hbench/depend
libexec/hbench/gen-analysis
libexec/hbench/gen-latgraph
libexec/hbench/gen-summary
libexec/hbench/getostype
libexec/hbench/interactive-setup
libexec/hbench/maindriver
libexec/hbench/stats-full
libexec/hbench/stats-single
share/doc/hbench/README
share/doc/hbench/benchmark-descriptions
share/doc/hbench/interpreting-results
share/doc/hbench/sigmetrics97-paper.ps.gz
share/doc/hbench/using-hbench
share/hbench/Results/Makefile
share/hbench/conf/full.test
share/hbench/conf/sample.run

View File

@@ -0,0 +1,28 @@
@comment $NetBSD: PLIST.i386,v 1.4 2009/06/14 17:33:11 joerg Exp $
libexec/hbench/${PLATFORM}-c/bw_bzero
libexec/hbench/${PLATFORM}-c/bw_file_rd
libexec/hbench/${PLATFORM}-c/bw_mem_cp
libexec/hbench/${PLATFORM}-c/bw_mem_rd
libexec/hbench/${PLATFORM}-c/bw_mem_wr
libexec/hbench/${PLATFORM}-c/bw_mmap_rd
libexec/hbench/${PLATFORM}-c/bw_pipe
libexec/hbench/${PLATFORM}-c/bw_tcp
libexec/hbench/${PLATFORM}-c/hello
libexec/hbench/${PLATFORM}-c/hello-s
libexec/hbench/${PLATFORM}-c/lat_connect
libexec/hbench/${PLATFORM}-c/lat_ctx
libexec/hbench/${PLATFORM}-c/lat_ctx2
libexec/hbench/${PLATFORM}-c/lat_fs
libexec/hbench/${PLATFORM}-c/lat_fslayer
libexec/hbench/${PLATFORM}-c/lat_mem_rd
libexec/hbench/${PLATFORM}-c/lat_mmap
libexec/hbench/${PLATFORM}-c/lat_pipe
libexec/hbench/${PLATFORM}-c/lat_proc
libexec/hbench/${PLATFORM}-c/lat_rpc
libexec/hbench/${PLATFORM}-c/lat_sig
libexec/hbench/${PLATFORM}-c/lat_syscall
libexec/hbench/${PLATFORM}-c/lat_tcp
libexec/hbench/${PLATFORM}-c/lat_udp
libexec/hbench/${PLATFORM}-c/memsize
libexec/hbench/${PLATFORM}-c/mhz
libexec/hbench/${PLATFORM}-c/mhz-counter

View File

@@ -0,0 +1,26 @@
$NetBSD: distinfo,v 1.19 2012/05/23 04:34:05 dholland Exp $
SHA1 (hbench-OS-1.1.tar.gz) = b6c98f5fc9cd306df6bdd2cf7d8254100118b01a
RMD160 (hbench-OS-1.1.tar.gz) = 023131dc9ae6239b9d64671e4128d691b78b310a
Size (hbench-OS-1.1.tar.gz) = 205361 bytes
SHA1 (hbench-OS-1.1-provisional-patch1.diff) = a27430f20a2210cd1283806b202aa1071cbc91a6
RMD160 (hbench-OS-1.1-provisional-patch1.diff) = ba6d79a400c86ad232b74414b6396c2839ca9258
Size (hbench-OS-1.1-provisional-patch1.diff) = 23836 bytes
SHA1 (patch-aa) = 525e78346621e6c4e34ace6fb1ed79e729aaa259
SHA1 (patch-ab) = ce446b5836aadc690c127ab41d52dee27fdb987c
SHA1 (patch-ac) = f6f570b66b5e32e8da14aec1b7afb8edc9088842
SHA1 (patch-ad) = f591b706c15daf4375896a4e47f005e422857a94
SHA1 (patch-ae) = faa6e73c7fffa23ab6ee8632b972ccaeef26d42c
SHA1 (patch-af) = 8c0562be1732807ea6fbce48fc51c83be1b3888a
SHA1 (patch-ag) = 037db0b965aad72ad8a1b93f9cf4b4af9f446fdf
SHA1 (patch-ah) = 52e3597539ebde61cb8d46a9f7feee51fd8f0185
SHA1 (patch-ai) = d59d05c9d73aa4c06f5ac5153a069694a4267fd1
SHA1 (patch-aj) = 7bca0c1062626b5c03f04b7bce17f7c2d8c14231
SHA1 (patch-al) = 53ac43ab3287f4ae7dc246aa9b047923e8acd8b6
SHA1 (patch-am) = 1d58355f664879ccd8880a63f574388fb61c0780
SHA1 (patch-an) = 9ac065d203081a5779b87cca69ecadfbeff5c970
SHA1 (patch-ao) = 69c92f83d10f061f8f0aa05da860cfc5cf764859
SHA1 (patch-ap) = 057465b9f89e76367781401d91b333679a651cb4
SHA1 (patch-aq) = 3174c28feeb8df6b7077653ab6e5df8fc5d3deb4
SHA1 (patch-as) = 5e6668a93610db020a4de0e46620b37f24e53309
SHA1 (patch-src_arch_i386_cyclecounter.c) = b2c41f7e2bae6deb561a4a010a2a8bb5eba3d19b

View File

@@ -0,0 +1,36 @@
#!/bin/sh
#
# $NetBSD: do-install,v 1.2 2005/12/29 03:26:28 reed Exp $
#
cd $WRKSRC
DIRS=`ls -d bin/*`
SCRIPTS="argsort config.guess config.sub create-all-analyses create-all-latgraphs create-all-summaries depend gen-analysis gen-latgraph gen-summary getostype interactive-setup maindriver stats-full stats-single"
DOCS="README benchmark-descriptions interpreting-results sigmetrics97-paper.ps.gz using-hbench"
mkdir -p $PREFIX/bin/hbench
mkdir -p $PREFIX/share/hbench
mkdir -p $PREFIX/share/hbench/Results
for basedir in $DIRS; do
OSDIR=`basename $basedir`
mkdir -p $PREFIX/bin/hbench/$OSDIR
$BSD_INSTALL_PROGRAM bin/$OSDIR/* $PREFIX/bin/hbench/$OSDIR
done
for files in $SCRIPTS; do
$BSD_INSTALL_SCRIPT scripts/$files $PREFIX/bin/hbench
done
mkdir -p $PREFIX/share/doc/hbench
for files in $DOCS; do
$BSD_INSTALL_DATA doc/$files $PREFIX/share/doc/hbench
done
cat <<EOF >$PREFIX/bin/run-hbench
#!/bin/sh
${PREFIX}/bin/hbench/interactive-setup
${PREFIX}/bin/hbench/maindriver ${PREFIX}/share/hbench/conf/`hostname`.run
EOF
chown $BINOWN:$BINGRP ${PREFIX}/bin/run-hbench
chmod 0755 ${PREFIX}/bin/run-hbench
cp Results/Makefile $PREFIX/share/hbench/Results
cp -R conf $PREFIX/share/hbench

View File

@@ -0,0 +1,13 @@
@wrksrc@/conf/full.test
@wrksrc@/XXX
@wrksrc@
@pwd@/results
@pwd@/conf/@hostname@.run

View File

@@ -0,0 +1,100 @@
$NetBSD: patch-aa,v 1.3 2011/09/12 11:15:33 dholland Exp $
--- scripts/interactive-setup.orig Thu Jun 26 17:37:25 1997
+++ scripts/interactive-setup Sat Sep 5 09:59:03 1998
@@ -35,7 +35,7 @@
# Setup defaults.
SYSTEMNAME=$HOSTNAME
-HOSTTYPE=`${SHELL} ./scripts/config.guess`
+HOSTTYPE=`${SHELL} @PREFIX@/bin/hbench/config.guess`
ARCH=`echo ${HOSTTYPE} | sed 's/-.*-.*$//'`
OSTYPE=`echo ${HOSTTYPE} | sed 's/^.*-.*-//'`
CYCLECOUNTER=NO
@@ -63,8 +63,8 @@
Welcome to HBench-OS! Before you can run the benchmarks, you need to
set up a few configuration parameters. This script will allow you to
interactively build a configuration file for this particular system;
-it will be saved by default in ./conf/${HOSTNAME}.run, unless you
-specify otherwise below. Once you have created ./conf/${HOSTNAME}.run,
+it will be saved by default in @PREFIX@/share/hbench/conf/${HOSTNAME}.run, unless you
+specify otherwise below. Once you have created @PREFIX@/share/hbench/conf/${HOSTNAME}.run,
either via this script, or manually, you can run the benchmarks by invoking
make run
@@ -108,8 +108,8 @@
# Now that we've got the hostname, try to read an existing run file
# to provide defaults.
-if [ -f ./conf/${SYSTEMNAME}.run ]; then
- . ./conf/${SYSTEMNAME}.run
+if [ -f @PREFIX@/share/hbench/conf/${SYSTEMNAME}.run ]; then
+ . @PREFIX@/share/hbench/conf/${SYSTEMNAME}.run
fi
@@ -119,7 +119,7 @@
echo $ECHON " System type (arch-vendor-os)? [default ${HOSTTYPE}] $ECHOC"
read PLATFORMIN
if [ X${PLATFORMIN}X != XX ]; then
- PLATFORMCHK=`${SHELL} ./scripts/config.sub $PLATFORMIN 2>&1`
+ PLATFORMCHK=`${SHELL} @PREFIX@/bin/hbench/config.sub $PLATFORMIN 2>&1`
if [ $? -eq 0 ]; then
HOSTTYPE=$PLATFORMCHK
AGAIN=N
@@ -191,10 +191,10 @@
HBench-OS determines what benchmarks to run by reading in a file that
specifies which benchmarks to include and what parameters to pass them.
-By default, the file ./conf/full.test is used, which runs the entire
+By default, the file @PREFIX@/share/hbench/conf/full.test is used, which runs the entire
HBench-OS benchmark suite. This is recommended for basic use; however,
if you are interested is a specific set of benchmarks, create a new
-test file in the ./conf directory and enter its name below (without
+test file in the @PREFIX@/share/hbench/conf directory and enter its name below (without
a directory specifier):
EOF
@@ -297,7 +297,7 @@
lat_rpc, lat_connect) run and measure the clients locally, but execute
the servers on a remote networked machine. Standard (non-counter-enabled)
binaries for each remote machine's architecture MUST be available in the
-./bin directory for the remote tests to work. Also, note that, for best
+@PREFIX@/bin/hbench directory for the remote tests to work. Also, note that, for best
results, the remote machines should be identical to the local machine,
and the network connecting them should be dedicated and quiescent.
@@ -345,13 +345,14 @@
By default, HBench-OS places results in a subdirectory <hostname>.run#/
of the base result directory. The default for the base run directory
-is ./Results/<os>-<arch>/, in this case ./Results/${OSTYPE}-${ARCH}/. If
+is @PREFIX@/share/hbench/Results/<os>-<arch>/, in this case
+@PREFIX@/share/hbench/Results/${OSTYPE}-${ARCH}/. If
you wish to alter the base directory location, enter the new directory now,
or just press Enter for the default:
EOF
-echo $ECHON " Alternate resultbase directory? [default ./Results/${OSTYPE}-${ARCH}] $ECHOC"
+echo $ECHON " Alternate resultbase directory? [default @PREFIX@/share/hbench/Results/${OSTYPE}-${ARCH}] $ECHOC"
read RDBIN
if [ X${RDBIN}X != XX ]; then
RESULTDIRBASE=$RDBIN
@@ -360,7 +361,7 @@
fi
# Pick a run filename
-RUNFILE=./conf/${SYSTEMNAME}.run
+RUNFILE=@PREFIX@/share/hbench/conf/${SYSTEMNAME}.run
cat <<EOF
By default, HBench-OS selects a .run file based on the machine's hostname.
@@ -380,7 +381,7 @@
Finally, note that if you have not built the HBench-OS binaries for your
architecture and counter selections in the default location
-(./bin/${OSTYPE}-${ARCH}/), then you must edit the generated run file
+(@PREFIX@/bin/hbench/${OSTYPE}-${ARCH}/), then you must edit the generated run file
manually to indicate where those binaries are.
===========

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-ab,v 1.5 2005/11/05 19:47:51 kristerw Exp $
--- scripts/create-all-analyses.orig 1997-06-27 02:37:12.000000000 +0200
+++ scripts/create-all-analyses 2005-11-05 20:39:31.000000000 +0100
@@ -33,6 +33,3 @@
-# Step 1: Discover hbench root path
-HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`
-
-for dir in */*
+for dir in @PREFIX@/share/hbench/*/*
do
@@ -40,3 +37,3 @@
echo "Running analysis on $dir..."
- ${HBENCHROOT}/scripts/gen-analysis $dir > ${dir}/analysis
+ @PREFIX@/bin/hbench/gen-analysis $dir > ${dir}/analysis
fi

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-ac,v 1.5 2005/11/05 19:47:51 kristerw Exp $
--- scripts/create-all-latgraphs.orig 1997-06-27 02:37:14.000000000 +0200
+++ scripts/create-all-latgraphs 2005-11-05 20:39:31.000000000 +0100
@@ -35,6 +35,3 @@
-# Step 1: Discover hbench root path
-HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`
-
-for dir in */*
+for dir in @PREFIX@/share/hbench/*/*
do
@@ -42,3 +39,3 @@
echo "Generating latency graph for $dir..."
- ${HBENCHROOT}/scripts/gen-latgraph -ps ${dir}/lat_mem_rd
+ @PREFIX@/bin/hbench/gen-latgraph -ps ${dir}/lat_mem_rd
fi

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-ad,v 1.5 2005/11/05 19:47:51 kristerw Exp $
--- scripts/create-all-summaries.orig 1997-06-27 02:37:14.000000000 +0200
+++ scripts/create-all-summaries 2005-11-05 20:39:31.000000000 +0100
@@ -33,6 +33,3 @@
-# Step 1: Discover hbench root path
-HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`
-
-for dir in */*
+for dir in @PREFIX@/share/hbench/*/*
do
@@ -40,3 +37,3 @@
echo Creating summary for $dir...
- ${HBENCHROOT}/scripts/gen-summary $dir > ${dir}/summary
+ @PREFIX@/bin/hbench/gen-summary $dir > ${dir}/summary
fi

View File

@@ -0,0 +1,151 @@
$NetBSD: patch-ae,v 1.2 1998/09/23 16:56:01 agc Exp $
--- scripts/gen-analysis.orig Sat Sep 5 09:17:12 1998
+++ scripts/gen-analysis Sat Sep 5 09:19:56 1998
@@ -47,8 +47,7 @@
}
# Step 1: Discover hbench root path
-$HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`;
-chop($HBENCHROOT);
+$HBENCHROOT="@PREFIX@/share/hbench";
# Some general system information
print "HBench-OS 1.0 Automatic Analysis Output\n";
@@ -100,7 +99,7 @@
$stable = 20;
$lastsize = 0.0;
foreach $file (@latencyfiles) {
- $val = `${HBENCHROOT}/scripts/stats-single lat_mem_rd/$file`;
+ $val = `@PREFIX@/bin/hbench/stats-single lat_mem_rd/$file`;
chop($val);
if ($val > $threshold*$lastval || $val < $lastval*(2-$threshold)) {
@@ -157,23 +156,23 @@
}
$drambuf = "4m";
-$l1read = `${HBENCHROOT}/scripts/stats-single bw_mem_rd_$l1buf`;
+$l1read = `@PREFIX@/bin/hbench/stats-single bw_mem_rd_$l1buf`;
chop($l1read);
-$l2read = `${HBENCHROOT}/scripts/stats-single bw_mem_rd_$l2buf`;
+$l2read = `@PREFIX@/bin/hbench/stats-single bw_mem_rd_$l2buf`;
chop($l2read);
-$dramread = `${HBENCHROOT}/scripts/stats-single bw_mem_rd_$drambuf`;
+$dramread = `@PREFIX@/bin/hbench/stats-single bw_mem_rd_$drambuf`;
chop($dramread);
-$l1write = `${HBENCHROOT}/scripts/stats-single bw_mem_wr_$l1buf`;
+$l1write = `@PREFIX@/bin/hbench/stats-single bw_mem_wr_$l1buf`;
chop($l1write);
-$l2write = `${HBENCHROOT}/scripts/stats-single bw_mem_wr_$l2buf`;
+$l2write = `@PREFIX@/bin/hbench/stats-single bw_mem_wr_$l2buf`;
chop($l2write);
-$dramwrite = `${HBENCHROOT}/scripts/stats-single bw_mem_wr_$drambuf`;
+$dramwrite = `@PREFIX@/bin/hbench/stats-single bw_mem_wr_$drambuf`;
chop($dramwrite);
-$l1zero = `${HBENCHROOT}/scripts/stats-single bw_bzero_$l1buf`;
+$l1zero = `@PREFIX@/bin/hbench/stats-single bw_bzero_$l1buf`;
chop($l1zero);
-$l2zero = `${HBENCHROOT}/scripts/stats-single bw_bzero_$l2buf`;
+$l2zero = `@PREFIX@/bin/hbench/stats-single bw_bzero_$l2buf`;
chop($l2zero);
-$dramzero = `${HBENCHROOT}/scripts/stats-single bw_bzero_$drambuf`;
+$dramzero = `@PREFIX@/bin/hbench/stats-single bw_bzero_$drambuf`;
chop($dramzero);
printf (" L1\$ : %.2fMB/sec read, %.2fMB/sec write, %.2f read/write ratio\n",
@@ -217,11 +216,11 @@
print "\n * Comparison of Projected and Measured Copy Bandwidths\n";
print " (projection is one-half the harmonic mean of raw read/write bandwidths)\n";
-$l1copy = `${HBENCHROOT}/scripts/stats-single bw_mem_cp_${l1buf}_libc_aligned`;
+$l1copy = `@PREFIX@/bin/hbench/stats-single bw_mem_cp_${l1buf}_libc_aligned`;
chop($l1copy);
-$l2copy = `${HBENCHROOT}/scripts/stats-single bw_mem_cp_${l2buf}_libc_aligned`;
+$l2copy = `@PREFIX@/bin/hbench/stats-single bw_mem_cp_${l2buf}_libc_aligned`;
chop($l2copy);
-$dramcopy = `${HBENCHROOT}/scripts/stats-single bw_mem_cp_${drambuf}_libc_aligned`;
+$dramcopy = `@PREFIX@/bin/hbench/stats-single bw_mem_cp_${drambuf}_libc_aligned`;
chop($dramcopy);
$l1proj = 1.0/(1.0/$l1read + 1.0/$l1write);
@@ -267,7 +266,7 @@
$func = $file;
$func =~ s/lat_syscall_//;
- $val = `${HBENCHROOT}/scripts/stats-single $file`;
+ $val = `@PREFIX@/bin/hbench/stats-single $file`;
chop($val);
if ($val < $minsyscall) {
$minsyscall2 = $minsyscall;
@@ -279,14 +278,14 @@
print " * Approximate \"null\" System Call Time: " . $minsyscall . " us\n";
print " The system call auto-selected for this case is: ". $syscallname."\n";
-print " Full statistics: " . `${HBENCHROOT}/scripts/stats-full lat_syscall_$syscallname`;
+print " Full statistics: " . `@PREFIX@/bin/hbench/stats-full lat_syscall_$syscallname`;
if ($syscallname eq "getpid") {
print " NOTE: the system call selected was getpid, which is frequently\n";
print " cached at user-level, and thus not a true system call. If\n";
print " you are unsure whether your system caches getpid, you should\n";
print " use the following (the second-fastest measured) system call instead:\n";
print " Time for the ".$syscallname2." system call: " . $minsyscall2 . " us\n";
- print " Full statistics: " . `${HBENCHROOT}/scripts/stats-full lat_syscall_$syscallname2`;
+ print " Full statistics: " . `@PREFIX@/bin/hbench/stats-full lat_syscall_$syscallname2`;
} else {
print " NOTE: this may be a cached system call, in which case the result\n";
print " is not representative of true null system call time.\n";
@@ -298,12 +297,12 @@
##
print " * Process Creation Analysis:\n";
print " Dynamic processes:\n";
-$nulld = `${HBENCHROOT}/scripts/stats-single lat_proc_null_dummy`;
+$nulld = `@PREFIX@/bin/hbench/stats-single lat_proc_null_dummy`;
chop($nulld);
$nulls = $nulld;
-$simpled = `${HBENCHROOT}/scripts/stats-single lat_proc_simple_dynamic`;
+$simpled = `@PREFIX@/bin/hbench/stats-single lat_proc_simple_dynamic`;
chop($simpled);
-$shd = `${HBENCHROOT}/scripts/stats-single lat_proc_sh_dynamic`;
+$shd = `@PREFIX@/bin/hbench/stats-single lat_proc_sh_dynamic`;
chop($shd);
$totald = $shd;
$shd -= $simpled;
@@ -316,9 +315,9 @@
if ( -f "lat_proc_simple_static" && -f "lat_proc_sh_static" ) {
print " Static processes:\n";
- $simples = `${HBENCHROOT}/scripts/stats-single lat_proc_simple_static`;
+ $simples = `@PREFIX@/bin/hbench/stats-single lat_proc_simple_static`;
chop($simples);
- $shs = `${HBENCHROOT}/scripts/stats-single lat_proc_sh_static`;
+ $shs = `@PREFIX@/bin/hbench/stats-single lat_proc_sh_static`;
chop($shs);
$totals = $shs;
$shs -= $simples;
@@ -340,7 +339,7 @@
print "\n * Virtual Memory Overhead in Mmap'd Read:\n";
print " (using $drambuf read to avoid low timer resolution)\n";
-$mmaprd = `${HBENCHROOT}/scripts/stats-single bw_mmap_rd_$drambuf`;
+$mmaprd = `@PREFIX@/bin/hbench/stats-single bw_mmap_rd_$drambuf`;
chop($mmaprd);
$mmapoverhead = 1000000/(256*$mmaprd) - 1000000/(256*$dramread);
printf(" Mmap read bandwidth: %.2fMB/sec; raw HW read bandwidth: %.2fMB/sec\n",
@@ -354,7 +353,7 @@
##
print "\n * TCP Network Stack Loopback Copy Overhead:\n";
-$tcpbw = `${HBENCHROOT}/scripts/stats-single bw_tcp_1m_localhost`;
+$tcpbw = `@PREFIX@/bin/hbench/stats-single bw_tcp_1m_localhost`;
chop($tcpbw);
printf(" TCP bandwidth (1MB buffer via localhost): %.2fMB/sec\n",$tcpbw);
@@ -375,7 +374,7 @@
##
print "\n * Pipe-based IPC Copy Overhead:\n";
-$pipebw = `${HBENCHROOT}/scripts/stats-single bw_pipe_$drambuf`;
+$pipebw = `@PREFIX@/bin/hbench/stats-single bw_pipe_$drambuf`;
chop($pipebw);
printf(" Pipe bandwidth ($drambuf transfer): %.2fMB/sec\n",$pipebw);

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-af,v 1.2 1998/09/23 16:56:01 agc Exp $
--- scripts/gen-latgraph.orig Sat Sep 5 09:20:49 1998
+++ scripts/gen-latgraph Sat Sep 5 09:22:07 1998
@@ -63,9 +63,6 @@
ECHON= ; ECHOC='\c'
fi
-# Step 1: Discover hbench root path
-HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`
-
# Step 2: Extract the parameters from each filename and get the data
# from the file, then put into the output file in proper format.
STRIDES=`ls rd_* | sed 's/rd_[0-9]*_//g' | sort -n -r | uniq`
@@ -83,7 +80,7 @@
do
size=`echo $file |sed "s/^rd_//" | sed "s/_.*$//"`
size=`echo $size | awk '{print $1/1024;}'`
- VAL=`${HBENCHROOT}/scripts/stats-single $file`
+ VAL=`@PREFIX@/bin/hbench/stats-single $file`
if [ `echo "$VAL $YMAX" | awk '{print ($1 > $2);}'` -gt 0 ]; then
YMAX=$VAL
fi

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-ag,v 1.2 1998/09/23 16:56:01 agc Exp $
--- scripts/gen-summary.orig Sat Sep 5 09:23:30 1998
+++ scripts/gen-summary Sat Sep 5 09:24:09 1998
@@ -45,9 +45,6 @@
exit 1
fi
-# Step 1: Discover hbench root path
-HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`
-
# Some general system information
echo "HBench-OS 1.0 Summary Output"
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
@@ -60,7 +57,7 @@
do
echo "${benchmark}:"
FILES="${benchmark}_* ${benchmark}"
- FILES=`echo ${FILES} | ${HBENCHROOT}/scripts/argsort`
+ FILES=`echo ${FILES} | @PREFIX@/bin/hbench/argsort`
for file in $FILES
do
if [ -f $file ]; then
@@ -70,7 +67,7 @@
fi
PARAMS="${PARAMS}: "
- echo " ${PARAMS}`${HBENCHROOT}/scripts/stats-full $file 2>&1`"
+ echo " ${PARAMS}`@PREFIX@/bin/hbench/stats-full $file 2>&1`"
fi
done
echo

View File

@@ -0,0 +1,82 @@
$NetBSD: patch-ah,v 1.3 2011/09/12 10:47:11 dholland Exp $
Make it installable (it was originally meant to be run out of its source tree)
--- scripts/maindriver.orig 2003-03-19 17:54:05.000000000 +0000
+++ scripts/maindriver
@@ -48,12 +48,6 @@ else
fi
-# Step 1: Discover hbench root path
-HBENCHROOT=`(cd \`dirname $0\`/.. ; pwd)`
-if [ X${HBENCHROOT}X = XX ]; then
- HBENCHROOT=$PWD
-fi
-
echo Current directory is $HBENCHROOT
# Step 2: Get run file name, check arguments, etc
@@ -99,16 +93,16 @@ if [ X${SCRATCHDIR}X = XX ]; then
fi
if [ X${PLAINBINDIR}X = XX ]; then
- PLAINBINDIR=${HBENCHROOT}/bin/${OSTYPE}-${ARCH}
+ PLAINBINDIR=@PREFIX@/bin/hbench/${OSTYPE}-${ARCH}
fi
if [ X${CYCLECOUNTERBINDIR}X = XX ]; then
- CYCLECOUNTERBINDIR=${HBENCHROOT}/bin/${OSTYPE}-${ARCH}-c
+ CYCLECOUNTERBINDIR=@PREFIX@/bin/hbench/${OSTYPE}-${ARCH}-c
fi
if [ X${EVENTCOUNTERBINDIR}X = XX ]; then
- EVENTCOUNTERBINDIR=${HBENCHROOT}/bin/${OSTYPE}-${ARCH}-ec
+ EVENTCOUNTERBINDIR=@PREFIX@/bin/hbench/${OSTYPE}-${ARCH}-ec
fi
if [ X${RESULTDIRBASE}X = XX ]; then
- RESULTDIRBASE=${HBENCHROOT}/Results/${OSTYPE}-${ARCH}
+ RESULTDIRBASE=@PREFIX@/share/hbench/Results/${OSTYPE}-${ARCH}
fi
RESULTDIRB=${RESULTDIRBASE}/${SYSTEMNAME}
@@ -125,10 +119,10 @@ if [ -f $TESTFILE ]; then
TESTS=${TESTFILE}
elif [ -f ${TESTFILE}.test ]; then
TESTS=${TESTFILE}.test
-elif [ -f ${HBENCHROOT}/conf/${TESTFILE} ]; then
- TESTS=${HBENCHROOT}/conf/${TESTFILE}
-elif [ -f ${HBENCHROOT}/conf/${TESTFILE}.test ]; then
- TESTS=${HBENCHROOT}/conf/${TESTFILE}.test
+elif [ -f @PREFIX@/share/hbench/conf/${TESTFILE} ]; then
+ TESTS=@PREFIX@/share/hbench/conf/${TESTFILE}
+elif [ -f @PREFIX@/share/hbench/conf/${TESTFILE}.test ]; then
+ TESTS=@PREFIX@/share/hbench/conf/${TESTFILE}.test
else
echo "Unable to locate test file ${TESTFILE}."
echo "Fix run file $1 and retry"
@@ -432,9 +426,9 @@ run_remote_test() {
;;
esac
else
- ${RCP} ${HBENCHROOT}/scripts/config.guess ${machine}:/tmp/get-os
+ ${RCP} @PREFIX@/bin/hbench/config.guess ${machine}:/tmp/get-os
REMOTEOS=`$RSH $machine -n /tmp/get-os | sed 's/^.*-.*-//`
- ${RCP} ${HBENCHROOT}/bin/${REMOTEOS}/$1 ${machine}:/tmp
+ ${RCP} @PREFIX@/bin/hbench/${REMOTEOS}/$1 ${machine}:/tmp
$RSH $machine -n /tmp/$1 0 $3 -s 2>> $STDERR &
fi
@@ -793,12 +787,12 @@ echo "done."
if [ X`perl -e 'print "perltest\n";' 2>&1`X = XperltestX ]; then
echo $ECHON "Generating summary information...${ECHOC}"
rm -f ${RESULTDIR}/summary
- ${HBENCHROOT}/scripts/gen-summary ${RESULTDIR} > ${RESULTDIR}/summary
+ @PREFIX@/bin/hbench/gen-summary ${RESULTDIR} > ${RESULTDIR}/summary
echo "done."
echo $ECHON "Performing basic automated data analysis...${ECHOC}"
rm -f ${RESULTDIR}/analysis
- ${HBENCHROOT}/scripts/gen-analysis ${RESULTDIR} > ${RESULTDIR}/analysis
+ @PREFIX@/bin/hbench/gen-analysis ${RESULTDIR} > ${RESULTDIR}/analysis
echo "done."
if [ `cat $RESULTDIR/errors | wc -l` -gt 0 ]; then

View File

@@ -0,0 +1,28 @@
$NetBSD: patch-ai,v 1.2 1998/09/23 16:56:01 agc Exp $
--- Results/Makefile.orig Sat Sep 5 09:35:16 1998
+++ Results/Makefile Sat Sep 5 09:36:22 1998
@@ -41,8 +41,8 @@
# RESULTS! USE WITH CARE!
SHELL=/bin/sh
-ARCH=`$(SHELL) ../scripts/config.guess | sed 's/-.*-.*$$//'`
-OS=`$(SHELL) ../scripts/config.guess | sed 's/^.*-.*-//'`
+ARCH=`$(SHELL) @PREFIX@/bin/hbench/config.guess | sed 's/-.*-.*$$//'`
+OS=`$(SHELL) @PREFIX@/bin/hbench/config.guess | sed 's/^.*-.*-//'`
default:
@echo "Select one of the following targets:"
@@ -78,10 +78,10 @@
@echo "a graph of the memory hierarchy latency for a given machine."
summaries:
- $(SHELL) ../scripts/create-all-summaries
+ $(SHELL) @PREFIX@/bin/hbench/create-all-summaries
analyses:
- $(SHELL) ../scripts/create-all-analyses
+ $(SHELL) @PREFIX@/bin/hbench/create-all-analyses
latencygraphs:
- $(SHELL) ../scripts/create-all-latgraphs
+ $(SHELL) @PREFIX@/bin/hbench/create-all-latgraphs

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-aj,v 1.1 1998/09/05 22:02:20 garbled Exp $
--- scripts/stats-full.orig Sat Sep 5 11:56:46 1998
+++ scripts/stats-full Sat Sep 5 11:57:38 1998
@@ -85,10 +85,10 @@
$sum += @vals[$i];
$sumsq += @vals[$i]*@vals[$i];
}
-
+# XXX count -1 ???
$count -= 2*$tailsize;
$avg = $sum/$count;
-$std = (1/($count - 1)) * ($sumsq - 2*$avg*$sum + $count*$avg*$avg);
+$std = (1/($count)) * ($sumsq - 2*$avg*$sum + $count*$avg*$avg);
$std = sqrt($std);
printf("%f (std. %f, %.2f%%) [median %f]\n",$avg,$std,100*$std/$avg,$median);

View File

@@ -0,0 +1,44 @@
$NetBSD: patch-al,v 1.4 2005/03/03 11:54:31 garbled Exp $
--- src/bw_pipe.c.orig 1997-06-26 17:34:33.000000000 -0700
+++ src/bw_pipe.c 2005-03-03 01:31:48.000000000 -0700
@@ -134,7 +134,7 @@
}
/* Amount to transfer */
- todo = XFERUNIT * num_iter;
+ todo = XFERUNIT * num_iter + bufsize;
/* Allocate buffer */
buf = (char *) malloc(bufsize);
@@ -147,6 +147,8 @@
/* Spawn off a writer, then time the read */
switch (fork()) {
case 0: /* writer */
+ close(pipes[0]);
+
while ((done < todo) &&
((n = write(pipes[1], buf, bufsize)) > 0))
done += n;
@@ -159,8 +161,13 @@
/*NOTREACHED*/
default: /* reader */
+ close(pipes[1]);
+
/* wait for writer */
- sleep(1);
+ while ((done < bufsize) &&
+ ((n = read(pipes[0], buf, bufsize - done)) > 0))
+ done += n;
+
start(); /* start timing */
while ((done < todo) &&
@@ -168,6 +175,7 @@
done += n;
*t = stop(); /* stop timing */
+ close(pipes[0]);
wait(&termstat); /* wait for writer to exit */
}

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-am,v 1.2 2005/03/03 11:54:31 garbled Exp $
--- ./src/lat_fs.c Fri Jun 27 01:34:38 1997
+++ work/hbench-OS/src/lat_fs.c Wed Aug 14 12:48:11 2002
@@ -229,8 +229,8 @@
if (deldir == DEL_REVERSE) {
for (i = 0; i < (num_iter +1)/2; i++) {
/* swap(filenames[i],filenames[numfiles - i]); */
- tmp = filenames[num_iter - i];
- filenames[num_iter - i] = filenames[i];
+ tmp = filenames[num_iter - 1 - i];
+ filenames[num_iter - 1 - i] = filenames[i];
filenames[i] = tmp;
}
} else if (deldir == DEL_PSEUDORANDOM) {

View File

@@ -0,0 +1,39 @@
$NetBSD: patch-an,v 1.3 2011/09/12 11:15:33 dholland Exp $
Speed up the loop calibration.
--- src/timing.c.orig 2011-09-12 10:54:05.000000000 +0000
+++ src/timing.c
@@ -252,15 +252,15 @@ gen_iterations(workfn, clkmul)
#ifdef DEBUG
printf(">> %u iteration gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
#endif
- while ((time = ((float)rtntime)*clkmul) < 1000000.) {
- /* while less than one second */
- num <<= 1;
+ while ((time = ((float)rtntime)*clkmul) < 1000000./16) {
+ /* while less than 1/16 second */
+ num <<= 2;
if ((*workfn)(num, &rtntime) != 0) {
num >>= 1;
#ifdef DEBUG
- printf(">> backing off\n");
+ printf(">> backing off to %u iterations\n", num);
#endif
- break;
+ return num;
}
#ifdef DEBUG
printf(">> %u iterations gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
@@ -271,6 +271,11 @@ gen_iterations(workfn, clkmul)
exit(1);
}
}
+ while (time < 1000000.) {
+ /* while less than one second */
+ num <<= 1;
+ time *= 2;
+ }
#ifdef DEBUG
printf(">> Choosing %u iterations\n", num);
#endif

View File

@@ -0,0 +1,33 @@
$NetBSD: patch-ao,v 1.2 2005/03/03 11:54:31 garbled Exp $
--- src/lat_ctx.c.orig 1997-06-26 17:34:37.000000000 -0700
+++ src/lat_ctx.c 2005-03-03 01:21:56.000000000 -0700
@@ -63,6 +63,7 @@
pid_t pids[MAX_PROCS]; /* process ID's */
int *pbuffer; /* memory buffer for procs to sum */
int *locdata; /* proc's memory buffer for procs to sum */
+int initial_niter; /* number of iterations we were requesed to do */
int
main(ac, av)
@@ -84,7 +85,7 @@
}
/* parse command line parameters */
- niter = atoi(av[1]);
+ initial_niter = niter = atoi(av[1]);
sprocs = parse_bytes(av[2]);
nprocs = atoi(av[3]);
@@ -276,6 +277,12 @@
int i;
clk_t val;
+ if (initial_niter == 0) {
+ /* We are only trying to find how many times to run the test */
+ do_overhead1(num_iter >> 1, t);
+ return 0;
+ }
+
centeravg_reset(OVERHEADAVG_LOOPS, OVERHEADAVG_TAILS);
for (i = OVERHEADAVG_LOOPS; i > 0; i--) {

View File

@@ -0,0 +1,33 @@
$NetBSD: patch-ap,v 1.2 2005/03/03 11:54:31 garbled Exp $
--- src/lat_ctx2.c.orig 1997-06-26 17:34:37.000000000 -0700
+++ src/lat_ctx2.c 2005-03-03 01:21:59.000000000 -0700
@@ -63,6 +63,7 @@
pid_t pids[MAX_PROCS]; /* process ID's */
int *pbuffer; /* memory buffer for procs to sum */
int *locdata; /* proc's memory buffer for procs to sum */
+int initial_niter; /* number of iterations we were requesed to do */
int
main(ac, av)
@@ -84,7 +85,7 @@
}
/* parse command line parameters */
- niter = atoi(av[1]);
+ initial_niter = niter = atoi(av[1]);
sprocs = parse_bytes(av[2]);
nprocs = atoi(av[3]);
@@ -251,6 +252,12 @@
int i;
clk_t val;
+ if (initial_niter == 0) {
+ /* We are only trying to find how many times to run the test */
+ do_overhead1(num_iter >> 1, t);
+ return 0;
+ }
+
centeravg_reset(OVERHEADAVG_LOOPS, OVERHEADAVG_TAILS);
for (i = OVERHEADAVG_LOOPS; i > 0; i--) {

View File

@@ -0,0 +1,39 @@
$NetBSD: patch-aq,v 1.6 2012/05/23 04:34:06 dholland Exp $
- fix parallel build
- solaris runs not only on sparc
- work around RMS's ego in config.guess output
--- src/Makefile.orig 2012-05-23 04:39:22.000000000 +0000
+++ src/Makefile
@@ -71,9 +71,9 @@ SHELL=/bin/sh
CC=gcc
PLATFORM=`$(SHELL) ../scripts/config.guess`
-ARCH=`$(SHELL) ../scripts/config.guess | sed 's/-.*-.*$$//'`
-OS=`$(SHELL) ../scripts/config.guess | sed 's/^.*-.*-//'`
-OSROOT=`$(SHELL) ../scripts/config.guess | sed 's/^.*-.*-//' | sed 's/[0-9].*$$//'`
+ARCH=`$(SHELL) ../scripts/config.guess | sed 's/-gnu$$//;s/-.*-.*$$//'`
+OS=`$(SHELL) ../scripts/config.guess | sed 's/-gnu$$//;s/^.*-.*-//'`
+OSROOT=`$(SHELL) ../scripts/config.guess | sed 's/-gnu$$//;s/^.*-.*-//' | sed 's/[0-9].*$$//'`
all:
@$(MAKE) BINDIR=../bin/$(OS)-$(ARCH) $(OSROOT)
@@ -121,7 +121,7 @@ bsdi:
@$(MAKE) LDLIBS="-lrpc" binaries
solaris:
- @$(MAKE) CC=gcc LDLIBS="-lnsl -lsocket -lcpc" SYS5=-DSYS5 CFLAGS="-Wa,-xarch=v8plusa $(CFLAGS_SPARC)" CPPFLAGS="-Wa,-xarch=v8plusa" binaries
+ @$(MAKE) CC=gcc LDLIBS="-lnsl -lsocket -lcpc" SYS5=-DSYS5 CFLAGS="$(CFLAGS_SPARC)" binaries
# HPUX needs gcc; their C compiler screws up mhz.c.
hpux:
@@ -170,7 +170,7 @@ EXES= $(BINDIR)/bw_bzero $(BINDIR)/bw_fi
$(BINDIR)/mhz $(BINDIR)/mhz-counter
# $(BINDIR)/lmdd $(BINDIR)/lat_pagefault
-binaries: setupdirs $(EXES)
+binaries: setupdirs .WAIT $(EXES)
clean:
@echo rm -rf ../bin/$(OS)-$(ARCH)*

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-as,v 1.1 2009/07/08 14:19:46 joerg Exp $
--- do-install.orig 2009-07-08 16:18:25.000000000 +0200
+++ do-install
@@ -27,8 +27,8 @@ for files in $DOCS; do
done
cat <<EOF >$PREFIX/bin/run-hbench
#!/bin/sh
-${PREFIX}/bin/hbench/interactive-setup
-${PREFIX}/bin/hbench/maindriver ${PREFIX}/share/hbench/conf/`hostname`.run
+${REAL_PREFIX}/bin/hbench/interactive-setup
+${REAL_PREFIX}/bin/hbench/maindriver ${REAL_PREFIX}/share/hbench/conf/`hostname`.run
EOF
chown $BINOWN:$BINGRP ${PREFIX}/bin/run-hbench
chmod 0755 ${PREFIX}/bin/run-hbench

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-src_arch_i386_cyclecounter.c,v 1.1 2012/02/28 15:49:56 hans Exp $
--- src/arch/i386/cyclecounter.c.orig 2003-02-28 18:19:53.000000000 +0100
+++ src/arch/i386/cyclecounter.c 2012-02-28 16:40:39.132704974 +0100
@@ -62,8 +62,8 @@
* instruction for the TCP bandwidth test.
*/
-typedef u_int32_t clk_t; /* time stamps are 64 bit on the Pentium Pro */
-typedef u_int64_t internal_clk_t;
+typedef uint32_t clk_t; /* time stamps are 64 bit on the Pentium Pro */
+typedef uint64_t internal_clk_t;
#define CLKTFMT "%d"
#define CLKTSTR(x) ((int)strtol(x, NULL, 10))