X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Frunvmstat;h=8a5a7df7c532754eb012f8f275fe78ddb83292de;hp=3ce68105290f8063c385d6d9de9030e1bb3697ce;hb=66397f7661093aba422aadbfd288f24bd434ff75;hpb=96ec6856f91f7f9031cfce4273c714d72cfe59ae 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