From 2334ba2bb1f5e2a780aecac079a33b5d0f1df1ef Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 20 Jan 2009 15:54:50 -0800
Subject: [PATCH] Add a script scripts, update Makefiles

---
 configure.ac                                  |  2 +
 scripts/Makefile.am                           |  3 +-
 scripts/zpios-profile/Makefile.am             |  1 +
 .../zpios-test/16th-8192rc-4rs-1cs-4off.sh    | 59 +++++++++++++++++++
 .../zpios-test/256th-65536rc-4rs-1cs-4off.sh  | 59 +++++++++++++++++++
 scripts/zpios-test/Makefile.am                |  1 +
 scripts/zpios-test/large.sh                   |  1 +
 scripts/zpios-test/medium.sh                  |  1 +
 8 files changed, 126 insertions(+), 1 deletion(-)
 create mode 100644 scripts/zpios-profile/Makefile.am
 create mode 100755 scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh
 create mode 100755 scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh
 create mode 100644 scripts/zpios-test/Makefile.am
 create mode 120000 scripts/zpios-test/large.sh
 create mode 120000 scripts/zpios-test/medium.sh

diff --git a/configure.ac b/configure.ac
index 3d9e1ae97c..5bb238d953 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,5 +95,7 @@ AC_CONFIG_FILES([
 	module/zpios/include/Makefile
 	scripts/Makefile
 	scripts/zpool-config/Makefile
+	scripts/zpios-test/Makefile
+	scripts/zpios-profile/Makefile
 ])
 AC_OUTPUT
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index ccfe5267ad..eed2ba25a0 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,5 +1,6 @@
-SUBDIRS = zpool-config
+SUBDIRS = zpool-config zpios-test zpios-profile
 EXTRA_DIST = common.sh zfs-update.sh zfs.sh zpool-create.sh
+EXTRA_DIST += zpios.sh zpios-survey.sh
 
 check:
 	./zfs.sh -v
diff --git a/scripts/zpios-profile/Makefile.am b/scripts/zpios-profile/Makefile.am
new file mode 100644
index 0000000000..07cf7ead3a
--- /dev/null
+++ b/scripts/zpios-profile/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = *.sh
diff --git a/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh b/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh
new file mode 100755
index 0000000000..37493b6f32
--- /dev/null
+++ b/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+#
+# Usage: zpios
+#         --chunksize         -c    =values
+#         --chunksize_low     -a    =value
+#         --chunksize_high    -b    =value
+#         --chunksize_incr    -g    =value
+#         --offset            -o    =values
+#         --offset_low        -m    =value
+#         --offset_high       -q    =value
+#         --offset_incr       -r    =value
+#         --regioncount       -n    =values
+#         --regioncount_low   -i    =value
+#         --regioncount_high  -j    =value
+#         --regioncount_incr  -k    =value
+#         --threadcount       -t    =values
+#         --threadcount_low   -l    =value
+#         --threadcount_high  -h    =value
+#         --threadcount_incr  -e    =value
+#         --regionsize        -s    =values
+#         --regionsize_low    -A    =value
+#         --regionsize_high   -B    =value
+#         --regionsize_incr   -C    =value
+#         --cleanup           -x
+#         --verify            -V
+#         --zerocopy          -z
+#         --threaddelay       -T    =jiffies
+#         --regionnoise       -I    =shift
+#         --chunknoise        -N    =bytes
+#         --prerun            -P    =pre-command
+#         --postrun           -R    =post-command
+#         --log               -G    =log directory
+#         --pool | --path     -p    =pool name
+#         --load              -L    =dmuio
+#         --help              -?    =this help
+#         --verbose           -v    =increase verbosity
+
+ZPIOS_CMD="${CMDDIR}/zpios/zpios                                 \
+	--load=dmuio                                             \
+	--path=${ZPOOL_NAME}                                     \
+	--threadcount=1                                          \
+	--regioncount=16                                         \
+	--regionsize=4M                                          \
+	--chunksize=1M                                           \
+	--offset=4M                                              \
+        --cleanup                                                \
+	--verbose                                                \
+	--human-readable                                         \
+	${ZPIOS_OPTIONS}"
+
+zpios_start() {
+	echo ${ZPIOS_CMD}
+	${ZPIOS_CMD} || exit 1
+}
+
+zpios_stop() {
+	echo
+}
diff --git a/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh b/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh
new file mode 100755
index 0000000000..4a160507f4
--- /dev/null
+++ b/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+#
+# Usage: zpios
+#         --chunksize         -c    =values
+#         --chunksize_low     -a    =value
+#         --chunksize_high    -b    =value
+#         --chunksize_incr    -g    =value
+#         --offset            -o    =values
+#         --offset_low        -m    =value
+#         --offset_high       -q    =value
+#         --offset_incr       -r    =value
+#         --regioncount       -n    =values
+#         --regioncount_low   -i    =value
+#         --regioncount_high  -j    =value
+#         --regioncount_incr  -k    =value
+#         --threadcount       -t    =values
+#         --threadcount_low   -l    =value
+#         --threadcount_high  -h    =value
+#         --threadcount_incr  -e    =value
+#         --regionsize        -s    =values
+#         --regionsize_low    -A    =value
+#         --regionsize_high   -B    =value
+#         --regionsize_incr   -C    =value
+#         --cleanup           -x
+#         --verify            -V
+#         --zerocopy          -z
+#         --threaddelay       -T    =jiffies
+#         --regionnoise       -I    =shift
+#         --chunknoise        -N    =bytes
+#         --prerun            -P    =pre-command
+#         --postrun           -R    =post-command
+#         --log               -G    =log directory
+#         --pool | --path     -p    =pool name
+#         --load              -L    =dmuio
+#         --help              -?    =this help
+#         --verbose           -v    =increase verbosity
+
+ZPIOS_CMD="${CMDDIR}/zpios/zpios                                 \
+	--load=dmuio                                             \
+	--path=${ZPOOL_NAME}                                     \
+	--threadcount=256                                        \
+	--regioncount=65536                                      \
+	--regionsize=4M                                          \
+	--chunksize=1M                                           \
+	--offset=4M                                              \
+        --cleanup                                                \
+	--verbose                                                \
+	--human-readable                                         \
+	${ZPIOS_OPTIONS}"
+
+zpios_start() {
+	echo ${ZPIOS_CMD}
+	${ZPIOS_CMD} || exit 1
+}
+
+zpios_stop() {
+	echo
+}
diff --git a/scripts/zpios-test/Makefile.am b/scripts/zpios-test/Makefile.am
new file mode 100644
index 0000000000..07cf7ead3a
--- /dev/null
+++ b/scripts/zpios-test/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = *.sh
diff --git a/scripts/zpios-test/large.sh b/scripts/zpios-test/large.sh
new file mode 120000
index 0000000000..b8e22bf54b
--- /dev/null
+++ b/scripts/zpios-test/large.sh
@@ -0,0 +1 @@
+256th-65536rc-4rs-1cs-4off.sh
\ No newline at end of file
diff --git a/scripts/zpios-test/medium.sh b/scripts/zpios-test/medium.sh
new file mode 120000
index 0000000000..d81027b739
--- /dev/null
+++ b/scripts/zpios-test/medium.sh
@@ -0,0 +1 @@
+16th-8192rc-4rs-1cs-4off.sh
\ No newline at end of file