Merge branch 'linux-zpios' into refs/top-bases/linux-zfs-branch

This commit is contained in:
Brian Behlendorf 2009-02-19 14:57:29 -08:00
commit 29946892d9
9 changed files with 302 additions and 250 deletions

View File

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
. ../.script-config
PROG=zpios-profile-post.sh PROG=zpios-profile-post.sh
RUN_POST=${0} RUN_POST=${0}
@ -19,44 +18,31 @@ RUN_THREAD_DELAY=${12}
RUN_FLAGS=${13} RUN_FLAGS=${13}
RUN_RESULT=${14} RUN_RESULT=${14}
PROFILE_ZPIOS_PIDS_BIN=${TOPDIR}/scripts/zpios-profile/zpios-profile-pids.sh
PROFILE_ZPIOS_PIDS_LOG=${RUN_LOG_DIR}/${RUN_ID}/pids-summary.csv
PROFILE_ZPIOS_DISK_BIN=${TOPDIR}/scripts/zpios-/profile/zpios-profile-disk.sh
PROFILE_ZPIOS_DISK_LOG=${RUN_LOG_DIR}/${RUN_ID}/disk-summary.csv
PROFILE_ZPIOS_ARC_LOG=${RUN_LOG_DIR}/${RUN_ID}/arcstats
PROFILE_ZPIOS_VDEV_LOG=${RUN_LOG_DIR}/${RUN_ID}/vdev_cache_stats
KERNEL_BIN="/lib/modules/`uname -r`/kernel/"
SPL_BIN="${SPLBUILD}/modules/spl/"
ZFS_BIN="${ZFSBUILD}/lib/"
OPROFILE_SHORT_ARGS="-a -g -l -p ${KERNEL_BIN},${SPL_BIN},${ZFS_BIN}"
OPROFILE_LONG_ARGS="-d -a -g -l -p ${KERNEL_BIN},${SPL_BIN},${ZFS_BIN}"
OPROFILE_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile.txt
OPROFILE_SHORT_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile-short.txt
OPROFILE_LONG_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile-long.txt
PROFILE_PID=${RUN_LOG_DIR}/${RUN_ID}/pid
if [ "${RUN_PHASE}" != "post" ]; then if [ "${RUN_PHASE}" != "post" ]; then
exit 1 exit 1
fi fi
# opcontrol --stop >>${OPROFILE_LOG} 2>&1 . ${RUN_LOG_DIR}/zpios-config.sh
# opcontrol --dump >>${OPROFILE_LOG} 2>&1 . ${RUN_LOG_DIR}/${RUN_ID}/zpios-config-run.sh
kill -s SIGHUP `cat ${PROFILE_PID}` #kill -s SIGHUP `cat ${PROFILE_PID}`
rm -f ${PROFILE_PID} #rm -f ${PROFILE_PID}
# opreport ${OPROFILE_SHORT_ARGS} >${OPROFILE_SHORT_LOG} 2>&1 OPROFILE_SHORT_ARGS="-a -g -l -p ${KERNEL_BIN},${SPL_BIN},${ZFS_BIN}"
# opreport ${OPROFILE_LONG_ARGS} >${OPROFILE_LONG_LOG} 2>&1 OPROFILE_LONG_ARGS="-d -a -g -l -p ${KERNEL_BIN},${SPL_BIN},${ZFS_BIN}"
# opcontrol --deinit >>${OPROFILE_LOG} 2>&1 /usr/bin/opcontrol --stop >>${OPROFILE_LOG} 2>&1
/usr/bin/opcontrol --dump >>${OPROFILE_LOG} 2>&1
/usr/bin/opreport ${OPROFILE_SHORT_ARGS} >${OPROFILE_SHORT_LOG} 2>&1
/usr/bin/opreport ${OPROFILE_LONG_ARGS} >${OPROFILE_LONG_LOG} 2>&1
cat /proc/spl/kstat/zfs/arcstats >${PROFILE_ZPIOS_ARC_LOG} if [ -f ${PROFILE_ARC_PROC} ]; then
cat /proc/spl/kstat/zfs/vdev_cache_stats >${PROFILE_ZPIOS_VDEV_LOG} cat ${PROFILE_ARC_PROC} >${PROFILE_ARC_LOG}
fi
if [ -f ${PROFILE_VDEV_CACHE_PROC} ]; then
cat ${PROFILE_VDEV_CACHE_PROC} >${PROFILE_VDEV_CACHE_LOG}
fi
# Summarize system time per pid # Summarize system time per pid
${PROFILE_ZPIOS_PIDS_BIN} ${RUN_LOG_DIR} ${RUN_ID} >${PROFILE_ZPIOS_PIDS_LOG} ${PROFILE_ZPIOS_PIDS_BIN} ${RUN_LOG_DIR} ${RUN_ID} >${PROFILE_ZPIOS_PIDS_LOG}

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
. ../common.sh
PROG=zpios-profile-pre.sh PROG=zpios-profile-pre.sh
PROFILE_ZPIOS_READY=0
trap "PROFILE_ZPIOS_READY=1" SIGHUP trap "PROFILE_ZPIOS_READY=1" SIGHUP
RUN_PRE=${0} RUN_PRE=${0}
@ -21,51 +21,74 @@ RUN_THREAD_DELAY=${12}
RUN_FLAGS=${13} RUN_FLAGS=${13}
RUN_RESULT=${14} RUN_RESULT=${14}
PROFILE_ZPIOS_BIN=${IOPDIR}/scripts/zpios-profile/zpios-profile.sh zpios_profile_run_cfg() {
PROFILE_ZPIOS_READY=0 cat > ${RUN_LOG_DIR}/${RUN_ID}/zpios-config-run.sh << EOF
#
# Zpios Profiling Configuration for Run ${RUN_ID}
#
PROFILE_PID=${RUN_LOG_DIR}/${RUN_ID}/profile.pid
PROFILE_ZPIOS_PIDS_LOG=${RUN_LOG_DIR}/${RUN_ID}/pids-summary.csv
PROFILE_ZPIOS_DISK_LOG=${RUN_LOG_DIR}/${RUN_ID}/disk-summary.csv
PROFILE_ARC_LOG=${RUN_LOG_DIR}/${RUN_ID}/arcstats
PROFILE_ARC_PROC=/proc/spl/kstat/zfs/arcstats
PROFILE_VDEV_CACHE_LOG=${RUN_LOG_DIR}/${RUN_ID}/vdev_cache_stats
PROFILE_VDEV_CACHE_PROC=/proc/spl/kstat/zfs/vdev_cache_stats
OPROFILE_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile.txt OPROFILE_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile.txt
PROFILE_PID=${RUN_LOG_DIR}/${RUN_ID}/pid OPROFILE_SHORT_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile-short.txt
RUN_ARGS=${RUN_LOG_DIR}/${RUN_ID}/args OPROFILE_LONG_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile-long.txt
EOF
}
zpios_profile_run_args() {
cat > ${RUN_LOG_DIR}/${RUN_ID}/zpios-args.txt << EOF
#
# Zpios Arguments for Run ${RUN_ID}
#
LOG_DIR=${RUN_LOG_DIR}
ID=${RUN_ID}
POOL=${RUN_POOL}
CHUNK_SIZE=${RUN_CHUNK_SIZE}
REGION_SIZE=${RUN_REGION_SIZE}
THREAD_COUNT=${RUN_THREAD_COUNT}
REGION_COUNT=${RUN_REGION_COUNT}
OFFSET=${RUN_OFFSET}
REGION_NOISE=${RUN_REGION_NOISE}
CHUNK_NOISE=${RUN_CHUNK_NOISE}
THREAD_DELAY=${RUN_THREAD_DELAY}
FLAGS=${RUN_FLAGS}
RESULT=${RUN_RESULT}
EOF
}
if [ "${RUN_PHASE}" != "pre" ]; then if [ "${RUN_PHASE}" != "pre" ]; then
exit 1 exit 1
fi fi
rm -Rf ${RUN_LOG_DIR}/${RUN_ID}/
mkdir -p ${RUN_LOG_DIR}/${RUN_ID}/ mkdir -p ${RUN_LOG_DIR}/${RUN_ID}/
zpios_profile_run_cfg
zpios_profile_run_args
echo "PHASE=${RUN_PHASE}" >>${RUN_ARGS} . ${RUN_LOG_DIR}/zpios-config.sh
echo "LOG_DIR=${RUN_LOG_DIR}" >>${RUN_ARGS} . ${RUN_LOG_DIR}/${RUN_ID}/zpios-config-run.sh
echo "ID=${RUN_ID}" >>${RUN_ARGS}
echo "POOL=${RUN_POOL}" >>${RUN_ARGS}
echo "CHUNK_SIZE=${RUN_CHUNK_SIZE}" >>${RUN_ARGS}
echo "REGION_SIZE=${RUN_REGION_SIZE}" >>${RUN_ARGS}
echo "THREAD_COUNT=${RUN_THREAD_COUNT}" >>${RUN_ARGS}
echo "REGION_COUNT=${RUN_REGION_COUNT}" >>${RUN_ARGS}
echo "OFFSET=${RUN_OFFSET}" >>${RUN_ARGS}
echo "REGION_NOISE=${RUN_REGION_NOISE}" >>${RUN_ARGS}
echo "CHUNK_NOISE=${RUN_CHUNK_NOISE}" >>${RUN_ARGS}
echo "THREAD_DELAY=${RUN_THREAD_DELAY}" >>${RUN_ARGS}
echo "FLAGS=${RUN_FLAGS}" >>${RUN_ARGS}
echo "RESULT=${RUN_RESULT}" >>${RUN_ARGS}
# XXX: Oprofile support seems to be broken when I try and start
# it via a user mode helper script, I suspect the setup is failing.
# opcontrol --init >>${OPROFILE_LOG} 2>&1
# opcontrol --setup --vmlinux=/boot/vmlinux >>${OPROFILE_LOG} 2>&1
# Start the profile script # Start the profile script
${PROFILE_ZPIOS_BIN} ${RUN_PHASE} ${RUN_LOG_DIR} ${RUN_ID} & #${PROFILE_ZPIOS_BIN} ${RUN_PHASE} ${RUN_LOG_DIR} ${RUN_ID} &
echo "$!" >${PROFILE_PID} #echo "$!" >${PROFILE_PID}
# Sleep waiting for profile script to be ready, it will # Sleep waiting for profile script to be ready, it will
# signal us via SIGHUP when it is ready to start profiling. # signal us via SIGHUP when it is ready to start profiling.
while [ ${PROFILE_ZPIOS_READY} -eq 0 ]; do #while [ ${PROFILE_ZPIOS_READY} -eq 0 ]; do
sleep 0.1 # sleep 0.1
done #done
# opcontrol --start-daemon >>${OPROFILE_LOG} 2>&1 /usr/bin/opcontrol --reset >>${OPROFILE_LOG} 2>&1
# opcontrol --start >>${OPROFILE_LOG} 2>&1 /usr/bin/opcontrol --start >>${OPROFILE_LOG} 2>&1
exit 0 exit 0

View File

@ -1,44 +1,45 @@
#!/bin/bash #!/bin/bash
# #
#
# Usage: zpios # 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 -t =values
# --threadcount_low -l =value # --threadcount_low -l =value
# --threadcount_high -h =value # --threadcount_high -h =value
# --threadcount_incr -e =value # --threadcount_incr -e =value
# --regioncount -n =values
# --regioncount_low -i =value
# --regioncount_high -j =value
# --regioncount_incr -k =value
# --offset -o =values
# --offset_low -m =value
# --offset_high -q =value
# --offset_incr -r =value
# --chunksize -c =values
# --chunksize_low -a =value
# --chunksize_high -b =value
# --chunksize_incr -g =value
# --regionsize -s =values # --regionsize -s =values
# --regionsize_low -A =value # --regionsize_low -A =value
# --regionsize_high -B =value # --regionsize_high -B =value
# --regionsize_incr -C =value # --regionsize_incr -C =value
# --load -L =dmuio|ssf|fpp
# --pool -p =pool name
# --cleanup -x # --cleanup -x
# --verify -V
# --zerocopy -z
# --threaddelay -T =jiffies
# --regionnoise -I =shift
# --chunknoise -N =bytes
# --prerun -P =pre-command # --prerun -P =pre-command
# --postrun -R =post-command # --postrun -R =post-command
# --log -G =log directory # --log -G =log directory
# --pool | --path -p =pool name # --regionnoise -I =shift
# --load -L =dmuio # --chunknoise -N =bytes
# --help -? =this help # --threaddelay -T =jiffies
# --verify -V
# --zerocopy -z
# --nowait -O
# --human-readable -H
# --verbose -v =increase verbosity # --verbose -v =increase verbosity
# --help -? =this help
ZPIOS_CMD="${CMDDIR}/zpios/zpios \ ZPIOS_CMD="${CMDDIR}/zpios/zpios \
--load=dmuio \ --load=dmuio \
--path=${ZPOOL_NAME} \ --pool=${ZPOOL_NAME} \
--threadcount=16 \ --threadcount=16 \
--regioncount=8192 \ --regioncount=8192 \
--regionsize=4M \ --regionsize=4M \

View File

@ -1,44 +1,46 @@
#!/bin/bash #!/bin/bash
# #
#
# Usage: zpios # 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 -t =values
# --threadcount_low -l =value # --threadcount_low -l =value
# --threadcount_high -h =value # --threadcount_high -h =value
# --threadcount_incr -e =value # --threadcount_incr -e =value
# --regioncount -n =values
# --regioncount_low -i =value
# --regioncount_high -j =value
# --regioncount_incr -k =value
# --offset -o =values
# --offset_low -m =value
# --offset_high -q =value
# --offset_incr -r =value
# --chunksize -c =values
# --chunksize_low -a =value
# --chunksize_high -b =value
# --chunksize_incr -g =value
# --regionsize -s =values # --regionsize -s =values
# --regionsize_low -A =value # --regionsize_low -A =value
# --regionsize_high -B =value # --regionsize_high -B =value
# --regionsize_incr -C =value # --regionsize_incr -C =value
# --load -L =dmuio|ssf|fpp
# --pool -p =pool name
# --cleanup -x # --cleanup -x
# --verify -V
# --zerocopy -z
# --threaddelay -T =jiffies
# --regionnoise -I =shift
# --chunknoise -N =bytes
# --prerun -P =pre-command # --prerun -P =pre-command
# --postrun -R =post-command # --postrun -R =post-command
# --log -G =log directory # --log -G =log directory
# --pool | --path -p =pool name # --regionnoise -I =shift
# --load -L =dmuio # --chunknoise -N =bytes
# --help -? =this help # --threaddelay -T =jiffies
# --verify -V
# --zerocopy -z
# --nowait -O
# --human-readable -H
# --verbose -v =increase verbosity # --verbose -v =increase verbosity
# --help -? =this help
ZPIOS_CMD="${CMDDIR}/zpios/zpios \ ZPIOS_CMD="${CMDDIR}/zpios/zpios \
--load=dmuio \ --load=dmuio \
--path=${ZPOOL_NAME} \ --pool=${ZPOOL_NAME} \
--threadcount=1 \ --threadcount=1 \
--regioncount=16 \ --regioncount=16 \
--regionsize=4M \ --regionsize=4M \

View File

@ -1,44 +1,45 @@
#!/bin/bash #!/bin/bash
# #
#
# Usage: zpios # 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 -t =values
# --threadcount_low -l =value # --threadcount_low -l =value
# --threadcount_high -h =value # --threadcount_high -h =value
# --threadcount_incr -e =value # --threadcount_incr -e =value
# --regioncount -n =values
# --regioncount_low -i =value
# --regioncount_high -j =value
# --regioncount_incr -k =value
# --offset -o =values
# --offset_low -m =value
# --offset_high -q =value
# --offset_incr -r =value
# --chunksize -c =values
# --chunksize_low -a =value
# --chunksize_high -b =value
# --chunksize_incr -g =value
# --regionsize -s =values # --regionsize -s =values
# --regionsize_low -A =value # --regionsize_low -A =value
# --regionsize_high -B =value # --regionsize_high -B =value
# --regionsize_incr -C =value # --regionsize_incr -C =value
# --load -L =dmuio|ssf|fpp
# --pool -p =pool name
# --cleanup -x # --cleanup -x
# --verify -V
# --zerocopy -z
# --threaddelay -T =jiffies
# --regionnoise -I =shift
# --chunknoise -N =bytes
# --prerun -P =pre-command # --prerun -P =pre-command
# --postrun -R =post-command # --postrun -R =post-command
# --log -G =log directory # --log -G =log directory
# --pool | --path -p =pool name # --regionnoise -I =shift
# --load -L =dmuio # --chunknoise -N =bytes
# --help -? =this help # --threaddelay -T =jiffies
# --verify -V
# --zerocopy -z
# --nowait -O
# --human-readable -H
# --verbose -v =increase verbosity # --verbose -v =increase verbosity
# --help -? =this help
ZPIOS_CMD="${CMDDIR}/zpios/zpios \ ZPIOS_CMD="${CMDDIR}/zpios/zpios \
--load=dmuio \ --load=dmuio \
--path=${ZPOOL_NAME} \ --pool=${ZPOOL_NAME} \
--threadcount=1,2,4,8,16,32,64,128,256 \ --threadcount=1,2,4,8,16,32,64,128,256 \
--regioncount=65536 \ --regioncount=65536 \
--regionsize=4M \ --regionsize=4M \

View File

@ -1,44 +1,45 @@
#!/bin/bash #!/bin/bash
# #
#
# Usage: zpios # 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 -t =values
# --threadcount_low -l =value # --threadcount_low -l =value
# --threadcount_high -h =value # --threadcount_high -h =value
# --threadcount_incr -e =value # --threadcount_incr -e =value
# --regioncount -n =values
# --regioncount_low -i =value
# --regioncount_high -j =value
# --regioncount_incr -k =value
# --offset -o =values
# --offset_low -m =value
# --offset_high -q =value
# --offset_incr -r =value
# --chunksize -c =values
# --chunksize_low -a =value
# --chunksize_high -b =value
# --chunksize_incr -g =value
# --regionsize -s =values # --regionsize -s =values
# --regionsize_low -A =value # --regionsize_low -A =value
# --regionsize_high -B =value # --regionsize_high -B =value
# --regionsize_incr -C =value # --regionsize_incr -C =value
# --load -L =dmuio|ssf|fpp
# --pool -p =pool name
# --cleanup -x # --cleanup -x
# --verify -V
# --zerocopy -z
# --threaddelay -T =jiffies
# --regionnoise -I =shift
# --chunknoise -N =bytes
# --prerun -P =pre-command # --prerun -P =pre-command
# --postrun -R =post-command # --postrun -R =post-command
# --log -G =log directory # --log -G =log directory
# --pool | --path -p =pool name # --regionnoise -I =shift
# --load -L =dmuio # --chunknoise -N =bytes
# --help -? =this help # --threaddelay -T =jiffies
# --verify -V
# --zerocopy -z
# --nowait -O
# --human-readable -H
# --verbose -v =increase verbosity # --verbose -v =increase verbosity
# --help -? =this help
ZPIOS_CMD="${CMDDIR}/zpios/zpios \ ZPIOS_CMD="${CMDDIR}/zpios/zpios \
--load=dmuio \ --load=dmuio \
--path=${ZPOOL_NAME} \ --pool=${ZPOOL_NAME} \
--threadcount=256 \ --threadcount=256 \
--regioncount=65536 \ --regioncount=65536 \
--regionsize=4M \ --regionsize=4M \

View File

@ -1,44 +1,45 @@
#!/bin/bash #!/bin/bash
# #
#
# Usage: zpios # 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 -t =values
# --threadcount_low -l =value # --threadcount_low -l =value
# --threadcount_high -h =value # --threadcount_high -h =value
# --threadcount_incr -e =value # --threadcount_incr -e =value
# --regioncount -n =values
# --regioncount_low -i =value
# --regioncount_high -j =value
# --regioncount_incr -k =value
# --offset -o =values
# --offset_low -m =value
# --offset_high -q =value
# --offset_incr -r =value
# --chunksize -c =values
# --chunksize_low -a =value
# --chunksize_high -b =value
# --chunksize_incr -g =value
# --regionsize -s =values # --regionsize -s =values
# --regionsize_low -A =value # --regionsize_low -A =value
# --regionsize_high -B =value # --regionsize_high -B =value
# --regionsize_incr -C =value # --regionsize_incr -C =value
# --load -L =dmuio|ssf|fpp
# --pool -p =pool name
# --cleanup -x # --cleanup -x
# --verify -V
# --zerocopy -z
# --threaddelay -T =jiffies
# --regionnoise -I =shift
# --chunknoise -N =bytes
# --prerun -P =pre-command # --prerun -P =pre-command
# --postrun -R =post-command # --postrun -R =post-command
# --log -G =log directory # --log -G =log directory
# --pool | --path -p =pool name # --regionnoise -I =shift
# --load -L =dmuio # --chunknoise -N =bytes
# --help -? =this help # --threaddelay -T =jiffies
# --verify -V
# --zerocopy -z
# --nowait -O
# --human-readable -H
# --verbose -v =increase verbosity # --verbose -v =increase verbosity
# --help -? =this help
ZPIOS_CMD="${CMDDIR}/zpios/zpios \ ZPIOS_CMD="${CMDDIR}/zpios/zpios \
--load=dmuio \ --load=dmuio \
--path=${ZPOOL_NAME} \ --pool=${ZPOOL_NAME} \
--threadcount=4 \ --threadcount=4 \
--regioncount=1024 \ --regioncount=1024 \
--regionsize=4M \ --regionsize=4M \

View File

@ -5,10 +5,7 @@
. ./common.sh . ./common.sh
PROG=zpios.sh PROG=zpios.sh
DATE=`date +%Y%m%d-%H%M%S`
PROFILE_ZPIOS_PRE=${TOPDIR}/scripts/zpios-profile/zpios-profile-pre.sh
PROFILE_ZPIOS_POST=${TOPDIR}/scripts/zpios-profile/zpios-profile-post.sh
PROFILE_ZPIOS_LOG=/tmp/
MODULES=( \ MODULES=( \
${MODDIR}/zpios/zpios.ko \ ${MODDIR}/zpios/zpios.ko \
@ -114,6 +111,43 @@ check_test() {
return 0 return 0
} }
zpios_profile_config() {
cat > ${PROFILE_ZPIOS_LOG}/zpios-config.sh << EOF
#
# Zpios Profiling Configuration
#
KERNEL_BIN="/lib/modules/`uname -r`/kernel/"
SPL_BIN="${SPLBUILD}/module/"
ZFS_BIN="${TOPDIR}/module/"
PROFILE_ZPIOS_BIN=${TOPDIR}/scripts/zpios-profile/zpios-profile.sh
PROFILE_ZPIOS_PIDS_BIN=${TOPDIR}/scripts/zpios-profile/zpios-profile-pids.sh
PROFILE_ZPIOS_DISK_BIN=${TOPDIR}/scripts/zpios-/profile/zpios-profile-disk.sh
EOF
}
zpios_profile_start() {
PROFILE_ZPIOS_PRE=${TOPDIR}/scripts/zpios-profile/zpios-profile-pre.sh
PROFILE_ZPIOS_POST=${TOPDIR}/scripts/zpios-profile/zpios-profile-post.sh
PROFILE_ZPIOS_LOG=/tmp/zpios/${ZPOOL_CONFIG}+${ZPIOS_TEST_ARG}+${DATE}
ZPIOS_OPTIONS="${ZPIOS_OPTIONS} --log=${PROFILE_ZPIOS_LOG}"
ZPIOS_OPTIONS="${ZPIOS_OPTIONS} --prerun=${PROFILE_ZPIOS_PRE}"
ZPIOS_OPTIONS="${ZPIOS_OPTIONS} --postrun=${PROFILE_ZPIOS_POST}"
mkdir -p ${PROFILE_ZPIOS_LOG}
zpios_profile_config
/usr/bin/opcontrol --init || exit 1
/usr/bin/opcontrol --setup --vmlinux=/boot/vmlinux || exit 1
}
zpios_profile_stop() {
/usr/bin/opcontrol --shutdown
/usr/bin/opcontrol --deinit
}
PROFILE= PROFILE=
ZPOOL_CONFIG=zpool-config.sh ZPOOL_CONFIG=zpool-config.sh
ZPIOS_TEST=zpios-test.sh ZPIOS_TEST=zpios-test.sh
@ -139,6 +173,7 @@ while getopts 'hvpc:t:o:l:s:' OPTION; do
ZPOOL_CONFIG=${OPTARG} ZPOOL_CONFIG=${OPTARG}
;; ;;
t) t)
ZPIOS_TEST_ARG=${OPTARG}
ZPIOS_TEST=${TOPDIR}/scripts/zpios-test/${OPTARG}.sh ZPIOS_TEST=${TOPDIR}/scripts/zpios-test/${OPTARG}.sh
;; ;;
o) o)
@ -188,17 +223,19 @@ fi
./zpool-create.sh ${VERBOSE_FLAG} -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} \ ./zpool-create.sh ${VERBOSE_FLAG} -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} \
-l "${ZPOOL_OPTIONS}" -s "${ZFS_OPTIONS}" || exit 1 -l "${ZPOOL_OPTIONS}" -s "${ZFS_OPTIONS}" || exit 1
if [ $PROFILE ]; then if [ ${PROFILE} ]; then
ZPIOS_CMD="${ZPIOS_CMD} --log=${PROFILE_ZPIOS_LOG}" zpios_profile_start
ZPIOS_CMD="${ZPIOS_CMD} --prerun=${PROFILE_ZPIOS_PRE}"
ZPIOS_CMD="${ZPIOS_CMD} --postrun=${PROFILE_ZPIOS_POST}"
fi fi
echo echo
date echo "${DATE}"
zpios_start zpios_start
zpios_stop zpios_stop
if [ ${PROFILE} ]; then
zpios_profile_stop
fi
if [ ${VERBOSE} ]; then if [ ${VERBOSE} ]; then
print_stats print_stats
fi fi