X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frunvmstat;h=8a5a7df7c532754eb012f8f275fe78ddb83292de;hb=df1d59429cbfd1ea2464e863458b6a4a268e516b;hp=3ce68105290f8063c385d6d9de9030e1bb3697ce;hpb=96ec6856f91f7f9031cfce4273c714d72cfe59ae;p=fs%2Flustre-release.git diff --git a/lustre/tests/runvmstat b/lustre/tests/runvmstat index 3ce6810..8a5a7df 100755 --- a/lustre/tests/runvmstat +++ b/lustre/tests/runvmstat @@ -1,5 +1,24 @@ #!/bin/sh -vmstat 1 | while read LINE ; do - echo "`date +s`: $LINE" - [ "$1" ] && echo "`date +s`: $LINE" >> $1 +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 done