From: Andreas Dilger Date: Tue, 16 Dec 2014 02:32:37 +0000 (-0700) Subject: LU-5810 tests: add client hostname to lctl mark X-Git-Tag: 2.8.54~44 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9c4156e6fc146a198bb342e28eb246f1076889bd LU-5810 tests: add client hostname to lctl mark Improve debug messages to include the originating hostname. Signed-off-by: Andreas Dilger Change-Id: I441bf8294c38135276a5a0f0853dbebf4358c563 Reviewed-on: http://review.whamcloud.com/13113 Tested-by: Jenkins Reviewed-by: Emoly Liu Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/lockorder.sh b/lustre/tests/lockorder.sh index 122df46..c21498d 100644 --- a/lustre/tests/lockorder.sh +++ b/lustre/tests/lockorder.sh @@ -56,7 +56,7 @@ mv $MAXDIR $LOCKDIR mv $MINFILE $LOCKFILE rm -rf $DIR/d$$ -$LCTL mark "start dir: $LOCKDIR=$MAXRES file: $LOCKFILE=$MINRES" +$LCTL mark "$HOSTNAME: start dir: $LOCKDIR=$MAXRES file: $LOCKFILE=$MINRES" # link will lock $LOCKFILE and $DIR as it creates ${LOCKFILE}{0,1,...} $CREATEMANY -l$LOCKFILE $LOCKFILE -$COUNT & CR_PID=$! diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 4c81abc..a36eeb1 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -308,7 +308,7 @@ run_test 11 "wake up a thread waiting for completion after eviction (b=2460)" #b=2494 test_12(){ - $LCTL mark $MULTIOP $DIR/$tfile OS_c + $LCTL mark "$HOSTNAME: $MULTIOP $DIR/$tfile OS_c" do_facet $SINGLEMDS "lctl set_param fail_loc=0x115" clear_failloc $SINGLEMDS $((TIMEOUT * 2)) & multiop_bg_pause $DIR/$tfile OS_c || diff --git a/lustre/tests/replay-single-lmv.sh b/lustre/tests/replay-single-lmv.sh index 21dd7ca..db137fe 100755 --- a/lustre/tests/replay-single-lmv.sh +++ b/lustre/tests/replay-single-lmv.sh @@ -94,22 +94,22 @@ test_2a() { run_test 2a "unlink cross-node file (fail mds with name)" test_3a() { - replay_barrier mds2 - mkdir $DIR/dir3a1 - $LCTL mark "FAILOVER mds2" - fail mds2 - stat $DIR - $CHECKSTAT -t dir $DIR/dir3a1 || return 1 + replay_barrier mds2 + mkdir $DIR/dir3a1 + $LCTL mark "$HOSTNAME FAILOVER mds2" + fail mds2 + stat $DIR + $CHECKSTAT -t dir $DIR/dir3a1 || return 1 } run_test 3a "mkdir cross-node dir (fail mds with inode)" test_3b() { - replay_barrier mds1 - mkdir $DIR/dir3b1 - $LCTL mark "FAILOVER mds1" - fail mds1 - stat $DIR - $CHECKSTAT -t dir $DIR/dir3b1 || return 1 + replay_barrier mds1 + mkdir $DIR/dir3b1 + $LCTL mark "$HOSTNAME FAILOVER mds1" + fail mds1 + stat $DIR + $CHECKSTAT -t dir $DIR/dir3b1 || return 1 } run_test 3b "mkdir cross-node dir (fail mds with inode)" diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index f74f3a3..0df8804 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -873,7 +873,7 @@ test_40(){ lctl get_param mdc.*.connect_flags | grep -q layout_lock && skip "layout_lock needs MDS connection for IO" && return 0 - $LCTL mark multiop $MOUNT/$tfile OS_c + $LCTL mark "$HOSTNAME multiop $MOUNT/$tfile OS_c" multiop $MOUNT/$tfile OS_c & PID=$! writeme -s $MOUNT/${tfile}-2 & diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 47a58fe..d9199d5 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -5289,14 +5289,14 @@ test_60d() { # verify "lctl mark" is even working" MESSAGE="test message ID $RANDOM $$" - $LCTL mark "$MESSAGE" || error "$LCTL mark failed" + $LCTL mark "$HOSTNAME $MESSAGE" || error "$LCTL mark failed" dmesg | grep -q "$MESSAGE" || error "didn't find debug marker in log" lctl set_param printk=0 || error "set lnet.printk failed" lctl get_param -n printk | grep emerg || error "lnet.printk dropped emerg" MESSAGE="new test message ID $RANDOM $$" # Assume here that libcfs_debug_mark_buffer() uses D_WARNING - $LCTL mark "$MESSAGE" || error "$LCTL mark failed" + $LCTL mark "$HOSTNAME $MESSAGE" || error "$LCTL mark failed" dmesg | grep -q "$MESSAGE" && error "D_WARNING wasn't masked" || true lctl set_param -n printk="$SAVEPRINTK" diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index e96bce8..738c837 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -1219,7 +1219,7 @@ test_36() { #bug 16417 sync; sleep 5; sync # wait for delete thread while [ $i -le 10 ]; do - lctl mark "start test" + lctl mark "$HOSTNAME start test loop $i" local before=$(lfs_df $MOUNT1 | awk '/^filesystem/{ print $4; exit }') dd if=/dev/zero of=$DIR1/$tdir/$tfile bs=1M count=$SIZE || error "dd $DIR1/$tdir/$tfile ${SIZE}MB failed" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 098a563..b323882 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2547,8 +2547,8 @@ replay_barrier() { # inside fail() and fail_abort(). # do_facet $facet $LCTL --device ${!svc} readonly - do_facet $facet $LCTL mark "$facet REPLAY BARRIER on ${!svc}" - $LCTL mark "local REPLAY BARRIER on ${!svc}" + do_facet $facet $LCTL mark "$HOSTNAME: $facet REPLAY BARRIER on ${!svc}" + $LCTL mark "$HOSTNAME: local REPLAY BARRIER on ${!svc}" } replay_barrier_nodf() { @@ -2558,8 +2558,8 @@ replay_barrier_nodf() { echo Replay barrier on ${!svc} do_facet $facet $LCTL --device ${!svc} notransno do_facet $facet $LCTL --device ${!svc} readonly - do_facet $facet $LCTL mark "$facet REPLAY BARRIER on ${!svc}" - $LCTL mark "local REPLAY BARRIER on ${!svc}" + do_facet $facet $LCTL mark "$HOSTNAME: $facet REPLAY BARRIER on ${!svc}" + $LCTL mark "$HOSTNAME: local REPLAY BARRIER on ${!svc}" } replay_barrier_nosync() { @@ -2568,8 +2568,8 @@ replay_barrier_nosync() { echo Replay barrier on ${!svc} do_facet $facet $LCTL --device ${!svc} notransno do_facet $facet $LCTL --device ${!svc} readonly - do_facet $facet $LCTL mark "$facet REPLAY BARRIER on ${!svc}" - $LCTL mark "local REPLAY BARRIER on ${!svc}" + do_facet $facet $LCTL mark "$HOSTNAME: $facet REPLAY BARRIER on ${!svc}" + $LCTL mark "$HOSTNAME: local REPLAY BARRIER on ${!svc}" } # @@ -2884,26 +2884,26 @@ change_active() { } do_node() { - local verbose=false - # do not stripe off hostname if verbose, bug 19215 - if [ x$1 = x--verbose ]; then - shift - verbose=true - fi + local verbose=false + # do not stripe off hostname if verbose, bug 19215 + if [ x$1 = x--verbose ]; then + shift + verbose=true + fi - local HOST=$1 - shift - local myPDSH=$PDSH - if [ "$HOST" = "$HOSTNAME" ]; then - myPDSH="no_dsh" - elif [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" ]; then - echo "cannot run remote command on $HOST with $myPDSH" - return 128 - fi - if $VERBOSE; then - echo "CMD: $HOST $@" >&2 - $myPDSH $HOST "$LCTL mark \"$@\"" > /dev/null 2>&1 || : - fi + local HOST=$1 + shift + local myPDSH=$PDSH + if [ "$HOST" = "$HOSTNAME" ]; then + myPDSH="no_dsh" + elif [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" ]; then + echo "cannot run remote command on $HOST with $myPDSH" + return 128 + fi + if $VERBOSE; then + echo "CMD: $HOST $@" >&2 + $myPDSH $HOST "$LCTL mark \"$HOSTNAME: $@\"" &>/dev/null || : + fi if [ "$myPDSH" = "rsh" ]; then # we need this because rsh does not return exit code of an executed command @@ -2999,17 +2999,18 @@ do_nodes() { return $? fi - # This is part from do_node - local myPDSH=$PDSH + # This is part from do_node + local myPDSH=$PDSH - [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" -o "$myPDSH" = "rsh" ] && \ - echo "cannot run remote command on $rnodes with $myPDSH" && return 128 + [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" -o "$myPDSH" = "rsh" ] && + echo "cannot run remote command on $rnodes with $myPDSH" && + return 128 - export FANOUT=$(get_node_count "${rnodes//,/ }") - if $VERBOSE; then - echo "CMD: $rnodes $@" >&2 - $myPDSH $rnodes "$LCTL mark \"$@\"" > /dev/null 2>&1 || : - fi + export FANOUT=$(get_node_count "${rnodes//,/ }") + if $VERBOSE; then + echo "CMD: $rnodes $@" >&2 + $myPDSH $rnodes "$LCTL mark \"$HOSTNAME: $@\"" &>/dev/null || : + fi # do not replace anything from pdsh output if -N is used # -N Disable hostname: prefix on lines of output. @@ -4624,10 +4625,10 @@ set_nodes_failloc () { } cancel_lru_locks() { - #$LCTL mark "cancel_lru_locks $1 start" + #$LCTL mark "$HOSTNAME: cancel_lru_locks $1 start" $LCTL set_param -n ldlm.namespaces.*$1*.lru_size=clear $LCTL get_param ldlm.namespaces.*$1*.lock_unused_count | grep -v '=0' - #$LCTL mark "cancel_lru_locks $1 stop" + #$LCTL mark "$HOSTNAME: cancel_lru_locks $1 stop" } default_lru_size() @@ -4925,17 +4926,18 @@ log() { echo "$*" >&2 load_module ../libcfs/libcfs/libcfs - local MSG="$*" - # Get rid of ' - MSG=${MSG//\'/\\\'} - MSG=${MSG//\(/\\\(} - MSG=${MSG//\)/\\\)} - MSG=${MSG//\;/\\\;} - MSG=${MSG//\|/\\\|} - MSG=${MSG//\>/\\\>} - MSG=${MSG//\ /dev/null || true + local MSG="$HOSTNAME: $*" + # Get rid of ' + MSG=${MSG//\'/\\\'} + MSG=${MSG//\(/\\\(} + MSG=${MSG//\)/\\\)} + MSG=${MSG//\;/\\\;} + MSG=${MSG//\|/\\\|} + MSG=${MSG//\>/\\\>} + MSG=${MSG//\ /dev/null || + true } trace() {