Merge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev
[xfstests-dev.git] / run.pio
1 #!/bin/bash
2 #
3 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it would be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write the Free Software Foundation,
16 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 #
18 #
19 # (very) simple parallel IO tests.
20 # TODO: make file size multiple of physmem.
21
22 filesize=1g
23 iosize=64k
24
25 if [ $# -gt 0 ]; then
26         printf "%s,%s,%s,%s,%s\n" type bytes ops time bytes/sec ops/sec
27         exit 0
28 fi
29
30 # buffered write
31 echo -n bwrite,
32 xfs_io iofile1  -Fft    -c "pwrite -C -b $iosize 0 $filesize" &
33 xfs_io iofile2  -Fft    -c "pwrite -C -b $iosize 0 $filesize"
34
35 # direct write
36 echo -n dwrite,
37 xfs_io iofile1  -Fftd   -c "pwrite -C -b $iosize 0 $filesize" &
38 xfs_io iofile2  -Fftd   -c "pwrite -C -b $iosize 0 $filesize"
39
40 # buffered re-write
41 echo -n brwrite,
42 xfs_io iofile1  -F      -c "pwrite -C -b $iosize 0 $filesize" &
43 xfs_io iofile2  -F      -c "pwrite -C -b $iosize 0 $filesize"
44
45 # direct re-write
46 echo -n drwrite,
47 xfs_io iofile1  -Fd     -c "pwrite -C -b $iosize 0 $filesize" &
48 xfs_io iofile2  -Fd     -c "pwrite -C -b $iosize 0 $filesize"
49
50 # buffered read
51 echo -n bread,
52 xfs_io iofile1  -F      -c "pread -C -b $iosize 0 $filesize" &
53 xfs_io iofile2  -F      -c "pread -C -b $iosize 0 $filesize"
54
55 # buffered re-read
56 echo -n brread,
57 xfs_io iofile1  -F      -c "pread -C -b $iosize 0 $filesize" &
58 xfs_io iofile2  -F      -c "pread -C -b $iosize 0 $filesize"
59
60 # direct read
61 echo -n dread,
62 xfs_io iofile1  -Fd     -c "pread -C -b $iosize 0 $filesize" &
63 xfs_io iofile2  -Fd     -c "pread -C -b $iosize 0 $filesize"
64
65 # direct re-read
66 echo -n drread,
67 xfs_io iofile1  -Fd     -c "pread -C -b $iosize 0 $filesize" &
68 xfs_io iofile2  -Fd     -c "pread -C -b $iosize 0 $filesize"
69