X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frunvmstat;h=8a5a7df7c532754eb012f8f275fe78ddb83292de;hb=3c580c93b8d3e94fac0ac2cf3cca2ff706c6497a;hp=6bff5cebefd84a8b46aebb067cac658a314231f1;hpb=7871725db54f50429e5b2eaaf6018b46e0e49af8;p=fs%2Flustre-release.git diff --git a/lustre/tests/runvmstat b/lustre/tests/runvmstat index 6bff5ce..8a5a7df 100755 --- a/lustre/tests/runvmstat +++ b/lustre/tests/runvmstat @@ -1,2 +1,24 @@ #!/bin/sh -vmstat 1 | while read LINE ; do echo "`date +%H:%M:%S`: $LINE" ; done +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