diff --git a/scripts/benchmarks/ffsb b/scripts/benchmarks/ffsb index e784f09..6e48f71 100755 --- a/scripts/benchmarks/ffsb +++ b/scripts/benchmarks/ffsb @@ -35,22 +35,37 @@ fi # Get the profile for the test. If the full path to the file isn't # given, check in $FFSB_DIR. If it's not there, check on GSA. -if [ ! -f $profile ]; then - pushd $FFSB_DIR > /dev/null - if [ ! -f $profile ]; then - wget -O $profile http://ausgsa.ibm.com/projects/l/ltcperformance/benchmarks/ffsb/resources/profiles/$profile - if [ $? -ne 0 -o ! -f $profile ]; then - log "ERROR: Unable to retrieve profile $profile." - popd > /dev/null - exit 1 - fi - fi - popd > /dev/null - profile="$FFSB_DIR/$profile" +#if [ ! -f $profile ]; then +# pushd $FFSB_DIR > /dev/null +# if [ ! -f $profile ]; then +# wget -O $profile http://ausgsa.ibm.com/projects/l/ltcperformance/benchmarks/ffsb/resources/profiles/$profile +# if [ $? -ne 0 -o ! -f $profile ]; then +# log "ERROR: Unable to retrieve profile $profile." +# popd > /dev/null +# exit 1 +# fi +# fi +# popd > /dev/null +# profile="$FFSB_DIR/$profile" +#if + +#log "Using profile $profile" +#cp $profile $LOGDIR/benchmark/profile + +# get profile directly into benchmark dir +get_file_as $LOGDIR/benchmark/profile $profile + +#if we failed to get profile, try old default location on GSA +if [ ! -s $LOGDIR/benchmark/profile ]; then + get_file_as $LOGDIR/benchmark/profile http://ausgsa.ibm.com/projects/l/ltcperformance/benchmarks/ffsb/resources/profiles/$profile fi -log "Using profile $profile" -cp $profile $LOGDIR/benchmark/profile +#If still no profile, time to go home. +if [ ! -s $LOGDIR/benchmark/profile ]; then + log "ERROR: Unable to retrieve profile $profile." + popd > /dev/null + exit 1 +fi for arg in $@; do log "Importing argument : $arg" diff --git a/scripts/disuseprofiler b/scripts/disuseprofiler index 1d13767..65deeeb 100755 --- a/scripts/disuseprofiler +++ b/scripts/disuseprofiler @@ -4,7 +4,6 @@ # issued, the default set of profilers (readprofile, sar, lockmeter) are used. # # reqparam value command - the name of the command to start/stop/install the profiler -# TMP_AUTODIR=`dirname $0` . $TMP_AUTODIR/../etc/autobench.conf || . $AUTODIR/scripts/functions @@ -14,31 +13,19 @@ if [ $# -lt 1 ]; then exit 1 fi -# call this script recursively when more than one argument -# is given to it. -if [ $# -gt 1 ]; then - for i in $*; do - "$0" "$i"; - done; - exit; -fi; - - -# Remove it from the list of profilers -if [ -e $TMPDIR/profilers ]; then - cat $TMPDIR/profilers | grep -v ^$1 > $TMPDIR/profilers.new - rm $TMPDIR/profilers - mv $TMPDIR/profilers.new $TMPDIR/profilers -fi - - -# Remove it to the start & stop profilers script -cat $AUTODIR/run/startprofilers | grep -v "# $1$" > $TMPDIR/startprofilers.new 2>/dev/null -rm $AUTODIR/run/startprofilers 2>/dev/null -mv $TMPDIR/startprofilers.new $AUTODIR/run/startprofilers -chmod a+x $AUTODIR/run/startprofilers - -cat $AUTODIR/run/stopprofilers | grep -v "# $1$" > $TMPDIR/stopprofilers.new 2>/dev/nul -rm $AUTODIR/run/stopprofilers 2>/dev/nul -mv $TMPDIR/stopprofilers.new $AUTODIR/run/stopprofilers -chmod a+x $AUTODIR/run/stopprofilers +for prof in $@; do + # Remove it from the list of profilers. + if [ -e $TMPDIR/profilers ]; then + grep -v ^$prof $TMPDIR/profilers > $TMPDIR/profilers.new 2> /dev/null + mv -f $TMPDIR/profilers.new $TMPDIR/profilers + fi + + # Remove it from the start & stop profilers script. + grep -v "# $prof$" $AUTODIR/run/startprofilers > $TMPDIR/startprofilers.new 2> /dev/null + mv -f $TMPDIR/startprofilers.new $AUTODIR/run/startprofilers + chmod a+x $AUTODIR/run/startprofilers + + grep -v "# $prof$" $AUTODIR/run/stopprofilers > $TMPDIR/stopprofilers.new 2> /dev/nul + mv -f $TMPDIR/stopprofilers.new $AUTODIR/run/stopprofilers + chmod a+x $AUTODIR/run/stopprofilers +done diff --git a/scripts/getsysinfo b/scripts/getsysinfo index 73a6701..bcd3205 100755 --- a/scripts/getsysinfo +++ b/scripts/getsysinfo @@ -294,3 +294,17 @@ then $AUTODIR/scripts/helpers/proc-interrupts-diff $2/proc/interrupts.before$RUN_SUFFIX $2/proc/interrupts.$1$RUN_SUFFIX > $2/proc/interrupts.diff$RUN_SUFFIX fi fi + +# BTRFS-specific info. +if [ $1 == 'before' ] +then + if [ -d "/tmp/build" ]; then + pushd /tmp/build > /dev/null + cg-log -M -v -r `cg-object-id -p $(cg-object-id)`..`cg-object-id` > $2/config/btrfs_changeset$RUN_SUFFIX + popd > /dev/null + fi + if which mkfs.btrfs > /dev/null 2>&1; then + mkfs.btrfs > $2/config/btrfs_mkfs$RUN_SUFFIX 2>&1 + fi +fi + diff --git a/scripts/profilers/blktrace b/scripts/profilers/blktrace index 5f6cd36..75e199a 100755 --- a/scripts/profilers/blktrace +++ b/scripts/profilers/blktrace @@ -1,67 +1,72 @@ #!/bin/bash # This is the script to start and stop the blktrace profiler. # -# reqparam value start|stop|report|postprocess|install Which action you'd like to perform -# reqparam value "device list" -# optparam value Suffix - an optional string to append to the name of the log file -# +# USAGE: +# blktrace [SUFFIX=log file suffix] +# command = start|stop|print-start|print-stop|report|postprocess|install TMP_AUTODIR=`dirname $0` . $TMP_AUTODIR/../../etc/autobench.conf || . $AUTODIR/scripts/functions if [ $# -lt 1 ]; then - echo "You must specify start, stop, report, postprocess, or install" - exit 1 + echo "You must specify start, stop, report, postprocess, or install" + echo "USAGE: `basename $0` [SUFFIX=log file suffix]" + echo " command = start|stop|print-start|print-stop|report|postprocess|install" + exit 1 fi +DEVICES="" +SUFFIX="" + CMD="`echo $1 | tr -t A-Z a-z`" +shift + +for arg; do + export $arg +done -if [ $# -eq 3 ]; then - SUFFIX=".$3" +if [ -z "$DEVICES" ]; then + exit 1 +fi +DEVICES=`echo $DEVICES | sed -e 's/,/ /g'` + +if ! mount | grep -q "^debugfs"; then + mount -t debugfs debugfs /sys/kernel/debug fi case $CMD in - install) - mount -t debugfs debugfs /sys/kernel/debug/ - if [ ! -e /autobench/sources/blktrace/blktrace ]; then +install) + if [ ! -e $AUTODIR/sources/blktrace/blktrace ]; then $AUTODIR/scripts/profilers/install/blktrace fi - ;; - start) - profiler_log 'starting blktrace' - mkdir $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX - pushd $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX - $AUTODIR/sources/blktrace/blktrace -d $2 & - popd - ;; - - print-start) - echo "profiler_log 'starting blktrace'" - echo 'mkdir $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX' - echo 'pushd $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX' - echo '$AUTODIR/sources/blktrace/blktrace -d '$2' &' - echo 'popd' - ;; + ;; - stop) - profiler_log 'stopping blktrace' - #stop vm-stat - # Full path is specified here so that we don't kill ourselves - killall blktrace - ;; +print-start) + echo 'profiler_log "starting blktrace"' + echo 'mkdir $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX' + echo 'pushd $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX > /dev/null' + echo '$AUTODIR/sources/blktrace/blktrace ' $DEVICES '&' + echo 'popd > /dev/null' + ;; - print-stop) - echo "profiler_log 'stopping blktrace'" - echo 'killall blktrace' - ;; +print-stop) + echo 'profiler_log "stopping blktrace"' + echo 'killall blktrace' + ;; - report) - ;; +report) + ;; - postprocess) - ;; +postprocess) + profiler_log 'post-processing blktrace' + pushd $LOGDIR/analysis/blktrace.$RUN_NUMBER$SUFFIX > /dev/null + for dev in $DEVICES; do + $AUTODIR/sources/blktrace/blkparse -o $dev.blkparse.out `basename $dev` + done + popd > /dev/null + ;; - *) - echo "The first argument must be start, stop, report, postprocess, or install" - ;; +*) + echo "The first argument must be start, stop, report, postprocess, or install" + ;; esac diff --git a/scripts/useprofiler b/scripts/useprofiler index a360813..68a810b 100755 --- a/scripts/useprofiler +++ b/scripts/useprofiler @@ -3,62 +3,54 @@ # runs the important section). If no use/disuseprofiler command are issued, # the default set of profilers (readprofile, schedstat, sar) are used. # -# reqparam value command - the name of the command to start/stop/install the profiler -# optparam value repeat arguments - any additional arguments to the profiler (not including a logfile suffix) -# +# USAGE: +# useprofiler [profiler-script-argument]+ TMP_AUTODIR=`dirname $0` . $TMP_AUTODIR/../etc/autobench.conf || . $AUTODIR/scripts/functions if [ $# -lt 1 ]; then - echo "You must specify a command to execute the profiler" - exit 1 + echo "USAGE: `basename $0` [profiler-script-argument]+" + exit 1 fi -# Add it to the list of profilers +profiler=$1 +shift + +# Add it to the list of profilers. Remove +# any previous instances of this profiler. if [ -e $TMPDIR/profilers ]; then - cat $TMPDIR/profilers | grep -v ^$1 > $TMPDIR/profilers.new - rm $TMPDIR/profilers - mv $TMPDIR/profilers.new $TMPDIR/profilers -else - disuseprofiler readcg - disuseprofiler sar - disuseprofiler schedstat - disuseprofiler readprofile + grep -v "^$profiler" $TMPDIR/profilers > $TMPDIR/profilers.new + mv -f $TMPDIR/profilers.new $TMPDIR/profilers fi -# if this is a remoteprofiler, add this line in a little later -# we need just one line in here, with all remote hostnames -if [ $1 != "remoteprofiler" ]; then - echo "$@" >> $TMPDIR/profilers +if [ $profiler != "remoteprofiler" ]; then + echo "$profiler $@" >> $TMPDIR/profilers fi -# save the profiler specified -profiler=$1 -shift - -# Make sure the profiler is installed and ready for use +# Make sure the profiler is installed and ready for use. $profiler install "$@" + # STARTPROFILERS ############################################################### +# Update the 'startprofilers' script. -# remove previous instances of the profiler -cat $AUTODIR/run/startprofilers | grep -v "# $profiler$" > $TMPDIR/startprofilers.new 2>/dev/null -rm $AUTODIR/run/startprofilers 2>/dev/null -mv $TMPDIR/startprofilers.new $AUTODIR/run/startprofilers +# Remove previous instances of the profiler +grep -v "# $profiler$" $AUTODIR/run/startprofilers > $TMPDIR/startprofilers.new 2> /dev/null +mv -f $TMPDIR/startprofilers.new $AUTODIR/run/startprofilers -# get the print-start output -# if this is a remote profiler, this will also create (through remoteprofiler call) a startremoteprofiler.hostname script +# Get the print-start output. If this is a remote profiler, this will also +# create (through remoteprofiler call) a startremoteprofiler.hostname script. ADD=`$profiler print-start "$@"` -# If this is a remoteprofiler and we specified many hosts, we get more than one line -# for the $ADD variable. Consolidate it down to one line and combine the hostnames -# in one arg +# If this is a remoteprofiler and we specified multiple hosts, we get more than +# one line for the $ADD variable. Consolidate it down to one line and combine +# the hostnames in one arg. -if [ "$profiler" = "remoteprofiler" ]; then - pushd $AUTODIR/run >/dev/null - filelist=`/bin/ls startremoteprofilers.*` - popd >/dev/null +if [ $profiler = "remoteprofiler" ]; then + pushd $AUTODIR/run > /dev/null + filelist=`ls startremoteprofilers.*` + popd > /dev/null hosts=`echo $filelist | sed -e 's/startremoteprofilers.//g'` hostlist="" for host in $hosts; do @@ -68,35 +60,36 @@ if [ "$profiler" = "remoteprofiler" ]; then hostlist="$hostlist,$host" fi done -ADD="$AUTODIR/scripts/profilers/remoteprofiler start $hostlist" - -# now that we have the hostlist for remoteprofilers, add the remoteprofiler line in profilers file -echo "remoteprofiler $hostlist" >>$TMPDIR/profilers + ADD="$AUTODIR/scripts/profilers/remoteprofiler start $hostlist" + # Now that we have the hostlist for remoteprofilers, add + # the remoteprofiler line in profilers file. + echo "remoteprofiler $hostlist" >> $TMPDIR/profilers fi -# add the print-start output and append the profiler key +# Add the print-start output and append the profiler key. echo "$ADD" | sed -e "s/$/ # $profiler/" >> $AUTODIR/run/startprofilers -# make sure startprofilers is executable +# Make sure startprofilers is executable. chmod a+x $AUTODIR/run/startprofilers + # STOPPROFILERS ################################################################ +# Update the 'stopprofilers' script. -# remove previous instances of the profiler -cat $AUTODIR/run/stopprofilers | grep -v "# $profiler$" > $TMPDIR/stopprofilers.new 2>/dev/null -rm $AUTODIR/run/stopprofilers 2>/dev/null -mv $TMPDIR/stopprofilers.new $AUTODIR/run/stopprofilers +# Remove previous instances of the profiler. +grep -v "# $profiler$" $AUTODIR/run/stopprofilers > $TMPDIR/stopprofilers.new 2> /dev/null +mv -f $TMPDIR/stopprofilers.new $AUTODIR/run/stopprofilers -# get the print-stop output +# Get the print-stop output. ADD=`$profiler print-stop "$@"` if [ "$profiler" = "remoteprofiler" ]; then -ADD="$AUTODIR/scripts/profilers/remoteprofiler stop $hostlist" + ADD="$AUTODIR/scripts/profilers/remoteprofiler stop $hostlist" fi -# add the print-stop output and append the profiler key +# Add the print-stop output and append the profiler key. echo "$ADD" | sed -e "s/$/ # $profiler/" >> $AUTODIR/run/stopprofilers -# make sure stopprofilers is executable +# Make sure stopprofilers is executable. chmod a+x $AUTODIR/run/stopprofilers