X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frunvmstat;h=8a5a7df7c532754eb012f8f275fe78ddb83292de;hb=3c580c93b8d3e94fac0ac2cf3cca2ff706c6497a;hp=b04d84c3fac9a1b905431f27ff0a857a982c46f3;hpb=067c526a4e5592095a3335478ec2580535ed2be4;p=fs%2Flustre-release.git diff --git a/lustre/tests/runvmstat b/lustre/tests/runvmstat index b04d84c..8a5a7df 100755 --- a/lustre/tests/runvmstat +++ b/lustre/tests/runvmstat @@ -1,6 +1,24 @@ #!/bin/sh -vmstat 1 | while read LINE ; do +DELAY=1 +null() { + : +} + +case "$1" in +-q) echo "echo off" + ECHO="null" + shift ;; +[1-9]*) + DELAY=$1 + ECHO=echo + shift ;; +*) + echo "echo on" + ECHO=echo +esac + +vmstat $DELAY | while read LINE ; do LINE="`date +%s`: $LINE" - echo $LINE - [ "$1" ] && echo $LINE >> $1 + $ECHO "$LINE" + [ "$1" ] && echo "$LINE" >> $1 done