From 4afe2201c86939ac0b71e0023ed9c8cf1a3e2923 Mon Sep 17 00:00:00 2001 From: zab <zab> Date: Thu, 5 Feb 2004 01:02:07 +0000 Subject: [PATCH] - collect basic oprofile results when it is available - make the output directory if it doesn't exist - add a forgotten item to the key --- lustre/scripts/bdev-io-survey.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lustre/scripts/bdev-io-survey.sh b/lustre/scripts/bdev-io-survey.sh index e55d0ba183..2643dfb4d5 100755 --- a/lustre/scripts/bdev-io-survey.sh +++ b/lustre/scripts/bdev-io-survey.sh @@ -578,6 +578,8 @@ test_one() { echo $test with $threads threads + $oprofile opcontrol --start + # start up vmstat and record its pid nice -19 vmstat 1 > $vmstat_log 2>&1 & [ $? = 0 ] || die "vmstat failed" @@ -594,6 +596,8 @@ test_one() { iostat_pids[$i]=$pid done + $oprofile opcontrol --reset + # start all the tests. each returns a pid to wait on pids="" for i in `seq 0 $last_block`; do @@ -623,6 +627,12 @@ test_one() { pid_has_stopped $pid done + $oprofile opcontrol --shutdown + $oprofile opreport > $tmpdir/oprofile + echo >> $tmpdir/oprofile + $oprofile opreport -c -l | head -20 >> $tmpdir/oprofile + save_output $tmpdir/oprofile $opref.oprofile + # collect the results of vmstat and iostat cpu=$(mean_stddev $(awk \ '(NR > 3 && NF == 16 && $16 != "id" ) \ @@ -756,8 +766,9 @@ if [ -z "$io_len" ]; then fi if [ ! -z "$output_dir" ]; then - [ ! -e "$output_dir" ] && "output dir $output_dir doesn't exist" - [ ! -d "$output_dir" ] && "output dir $output_dir isn't a directory" + [ ! -e "$output_dir" ] && mkdir -p "$output_dir" || die \ + "error creating $output_dir" + [ ! -d "$output_dir" ] && die "$output_dir isn't a directory" fi block=`echo $block | sed -e 's/,/ /g'` @@ -771,6 +782,14 @@ for t in $run_tests; do fi done +if which opcontrol; then + echo generating oprofile results + oprofile="" +else + echo not using oprofile + oprofile=": " +fi + [ $min_threads -gt $max_threads ] && \ die "min threads $min_threads must be <= min_threads $min_threads" @@ -816,6 +835,7 @@ done echo "T = number of concurrent threads per device" echo "L = base io operation length, in KB" echo "m = IO method: read, write, or over-write" + echo "A = aggregate throughput from all devices" echo "C = percentage CPU used, both user and system" echo "MB/s = per-device throughput" echo "rR = read requests issued to the device per second" -- GitLab