# 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"
# 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() {
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() {
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}"
}
#
}
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
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.
}
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()
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//\</\\\<}
- MSG=${MSG//\//\\\/}
- do_nodes $(comma_list $(nodes_list)) $LCTL mark "$MSG" 2> /dev/null || true
+ local MSG="$HOSTNAME: $*"
+ # Get rid of '
+ MSG=${MSG//\'/\\\'}
+ MSG=${MSG//\(/\\\(}
+ MSG=${MSG//\)/\\\)}
+ MSG=${MSG//\;/\\\;}
+ MSG=${MSG//\|/\\\|}
+ MSG=${MSG//\>/\\\>}
+ MSG=${MSG//\</\\\<}
+ MSG=${MSG//\//\\\/}
+ do_nodes $(comma_list $(nodes_list)) $LCTL mark "$MSG" 2> /dev/null ||
+ true
}
trace() {