From c2797a87f20273ca665063a04786f6400dfc3cb1 Mon Sep 17 00:00:00 2001 From: fanyong Date: Wed, 21 Jan 2009 03:26:52 +0000 Subject: [PATCH] Branch b1_8 b=15691 i=huanghua i=yep Another diagnostic patch to collect more log when error. --- lustre/tests/sanity.sh | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index b0b0bc6..bd8fba3 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -4995,7 +4995,7 @@ test_123a() { # was test 123, statahead(bug 11401) cancel_lru_locks mdc cancel_lru_locks osc stime=`date +%s` - time ls -l $DIR/$tdir > /dev/null + time ls -l $DIR/$tdir | wc -l etime=`date +%s` delta=$((etime - stime)) log "ls $i files without statahead: $delta sec" @@ -5006,10 +5006,10 @@ test_123a() { # was test 123, statahead(bug 11401) cancel_lru_locks mdc cancel_lru_locks osc stime=`date +%s` - time ls -l $DIR/$tdir > /dev/null + time ls -l $DIR/$tdir | wc -l etime=`date +%s` delta_sa=$((etime - stime)) - log "ls $i files with statahead: $delta_sa sec" + log "ls $i files with statahead: $delta_sa sec" lctl get_param -n llite.*.statahead_stats ewrong=`lctl get_param -n llite.*.statahead_stats | grep "statahead wrong:" | awk '{print $3}'` @@ -5017,13 +5017,41 @@ test_123a() { # was test 123, statahead(bug 11401) log "statahead was stopped, maybe too many locks held!" fi + [ $delta -eq 0 ] && continue + if [ $((delta_sa * 100)) -gt $((delta * 105)) ]; then if [ $SLOWOK -eq 0 ]; then error "ls $i files is slower with statahead!" + + max=`lctl get_param -n llite.*.statahead_max | head -n 1` + lctl set_param -n llite.*.statahead_max 0 + lctl get_param llite.*.statahead_max + cancel_lru_locks mdc + cancel_lru_locks osc + $LCTL dk > /dev/null + stime=`date +%s` + time ls -l $DIR/$tdir | wc -l + etime=`date +%s` + $LCTL dk > $TMP/sanity_test_123a_${i}_disable_${etime}.log + delta=$((etime - stime)) + log "ls $i files without statahead: $delta sec, dump to $TMP/sanity_test_123a_${i}_disable_${etime}.log" + lctl set_param llite.*.statahead_max=$max + + lctl get_param -n llite.*.statahead_max | grep '[0-9]' + cancel_lru_locks mdc + cancel_lru_locks osc + $LCTL dk > /dev/null + stime=`date +%s` + time ls -l $DIR/$tdir | wc -l + etime=`date +%s` + $LCTL dk > $TMP/sanity_test_123a_${i}_enable_${etime}.log + delta_sa=$((etime - stime)) + log "ls $i files with statahead: $delta_sa sec, dump to $TMP/sanity_test_123a_${i}_enable_${etime}.log" + lctl get_param -n llite.*.statahead_stats else log "ls $i files is slower with statahead!" fi - break; + break fi [ $delta -gt 20 ] && break -- 1.8.3.1