xfstests: add test 185, Dmapi Punch/Probe Alignment compared to xfsctl(FREESPACE),
[xfstests-dev.git] / run.bonnie_io
1 #!/bin/sh
2
3 # Does a bonnie throughput run (80M file and 1K chunksize if the
4 # BONNIE_FILESIZE and/or BONNIE_CHUNKSIZE variables are not set),
5 # then massages the output into CSV format with the human-readable
6 # output preceding it as a "comment" (ie. #-prefixed).
7
8 BONNIE_FILESIZE=${BONNIE_FILESIZE:=500M}
9 BONNIE_CHUNKSIZE=${BONNIE_CHUNKSIZE:=1K}
10
11 [ -z "$here" ] && here=`pwd`
12 . $here/common.bonnie
13
14
15 # Sample bonnie throughput output (stderr):
16 #Version 1.02c       ------Sequential Output------ --Sequential Input- --Random-
17 #                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
18 #Machine   Size:chnk K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
19 #          150M:64k           52024  99 88969  99           245492 100  3746 264
20
21 filter_stderr()
22 {
23         sed -e 's/^..................../# /g' | awk '{print} END {print "#"}'
24 }
25
26
27 # Sample bonnie throughput output (stdout):
28 # ",150M:64k,,,52024,99,88969,99,,,245492,100,3746.0,264,,,,,,,,,,,,,"
29
30 filter_stdout()
31 {
32         perl -ne '
33                 chomp;
34                 s/,+/,/g; s/^,//; s/,$//;
35                 @values = split /,/;
36                 printf "%9s", shift @values;
37                 for ($i = 0; $i <= $#values; $i++) {
38                         if ($i % 2) { printf ",%4s%%", $values[$i] }
39                         else        { printf ",%10s", $values[$i] }
40                 }
41                 printf "\n";
42         '
43 }
44
45 if [ $# -gt 0 ]; then
46         printf "%9s,%10s,%5s,%10s,%5s,%10s,%5s,%10s,%5s\n" size:chnk \
47                 writeK/s wCPU rewriteK/s rwCPU readK/s rCPU seek/s sCPU
48         exit 0
49 fi
50 run_bonnie -n 0 -s $BONNIE_FILESIZE:$BONNIE_CHUNKSIZE