From dc9d71051c23d305db4430ce122e9752c3ce19dd Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 23 Jul 2018 14:19:11 -0600 Subject: [PATCH] LU-11166 tests: remove use of /proc/fs/jbd2/*/history file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The /proc/fs/jbd2/*/history file was removed several years ago with a patch from Theodore Ts’o; commit bf6993276f. We need to remove all uses of /proc/fs/jbd*/*/history from our tests and utilities. In particular, obdfilter-survey.sh and iokit-lstat rely on /proc/fs/jbd2/*/history to collect data and must be modified. Test-Parameters: trivial testlist=obdfilter-survey Signed-off-by: James Nunez Change-Id: Ib25dd28a496840199de1e84f597748905bda80d2 Reviewed-on: https://review.whamcloud.com/32858 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- lustre-iokit/stats-collect/iokit-lstats | 56 +---------------------------- lustre/tests/obdfilter-survey.sh | 62 +++------------------------------ 2 files changed, 5 insertions(+), 113 deletions(-) diff --git a/lustre-iokit/stats-collect/iokit-lstats b/lustre-iokit/stats-collect/iokit-lstats index 86f1214..9bb974f 100755 --- a/lustre-iokit/stats-collect/iokit-lstats +++ b/lustre-iokit/stats-collect/iokit-lstats @@ -10,7 +10,7 @@ # 0 - gather stats at start and stop only # N - gather stats every N seconds # if some XXX_INTERVAL isn't specified, related stats won't be collected -# XXX can be: VMSTAT, SERVICE, BRW, SDIO, MBALLOC, IO, JBD +# XXX can be: VMSTAT, SERVICE, BRW, SDIO, MBALLOC, IO # # to stop collection: # iokit-lstats stop @@ -511,59 +511,6 @@ function io_start() } # -# jbd_stats collector -# -# JBD_INVERVAL: -# - 0 - collect at start and stop only -# - N - isn't implemented yet, works as with 0 -# -function jbd_collector() -{ - local obd=$1 - local uuid=$(lctl get_param -n obd.uuid 2>&1) - local tmp=$(lctl get_param -n obd.mntdev 2>&1) - local disk=$(basename $tmp) - local file="/proc/fs/jbd/${disk}/history" - - echo "jbd history for ${uuid}/${disk} " $(date) - - if let "JBD_INTERVAL==0"; then - idle_collector - cat $file - elif let "JBD_INTERVAL>0"; then - idle_collector - cat $file - else - echo "Invalid JBD_INTERVAL=$JBD_INTERVAL" - idle_collector - fi -} - -function jbd_start() -{ - if [ "$JBD_INTERVAL" == "" ]; then - return; - fi - - # find all obdfilters and MDSs - for i in $(lctl list_param obdfilter.* mds.*); do - obd=$(echo "$i" | awk -F"." '{print $2}') - if [ "$obd" == "num_refs" ]; then - continue; - fi - local tmp=$(lctl get_param -n ${i}.mntdev 2>&1) - if [ $? != 0 ]; then - continue; - fi - local disk=$(basename $tmp) - if [ ! -f /proc/fs/jbd/${disk}/history ]; then - continue; - fi - run_collector "jbd" jbd_collector ${i} & - done -} - -# # start entry point # function ls_start() @@ -594,7 +541,6 @@ function ls_start() sdio_start mballoc_start io_start - jbd_start client_start } diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index 0c1b6bf..bf5189a 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -17,9 +17,9 @@ init_logging [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; } thrlo=${thrlo:-$(( thrhi / 2))} -# Skip these tests -# bug number 23791 23791 -ALWAYS_EXCEPT="1b 2b $OBDFILTER_SURVEY_EXCEPT" +# bug number for skipped test: +ALWAYS_EXCEPT="$OBDFILTER_SURVEY_EXCEPT" +# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! OBDSURVEY=${OBDSURVEY:-$(which obdfilter-survey)} @@ -85,60 +85,12 @@ obdflter_survey_run () { cat ${TMP}/obdfilter_survey* [ $rc = 0 ] || error "$OBDSURVEY failed: $rc" } + test_1a () { obdflter_survey_run disk } run_test 1a "Object Storage Targets survey" -print_jbd () { - local file=$1 - local facet=$2 - local varsvc=${facet}_svc - local dev=$(ldiskfs_canon "*.${!varsvc}.mntdev" $facet) - - # ext4: /proc/fs/jbd2/sda1:8/history - # ext3: /proc/fs/jbd/sdb1/history - - do_facet $facet cat /proc/fs/jbd*/${dev}*/$file -} - -check_jbd_values () { - local facet=$1 - local thrhi=$2 - local rtime=$3 - - # last two lines from history - # $4: run >= 5000 - # $8: hndls >= thrhi * 2 - # display history of rtime/4 before, in case obd cleanup consumes time - local tlines=$((rtime / 5 / 4 + 1)) - local hist=("$(print_jbd history $facet | tail -$tlines | head -n1)") - echo "$hist" - local run=($(echo "${hist[*]}" | awk '{print $4}')) - local hndls=($(echo "${hist[*]}" | awk '{print $8}')) - - local rc=0 - for (( i=0; i<1; i++)); do - [[ ${run[i]} -lt 5000 ]] && \ - error "$facet: run expected 5000, have ${run[i]}" && rc=1 - [[ ${hndls[i]} -lt $((thrhi * 2)) ]] && \ - error "$facet: hndls expected > $((thrhi * 2)), have ${hndls[i]}" && rc=2 - done - return $rc -} - -check_jbd_values_facets () { - local facets=$1 - local thrhi=$2 - local rtime=$3 - local facet - local rc=0 - for facet in ${facets//,/ }; do - check_jbd_values $facet $thrhi $rtime || rc=$((rc+$?)) - done - return $rc -} - test_1b () { local param_file=$TMP/$tfile-params @@ -156,12 +108,9 @@ test_1b () { local rtime=$((etime - stime)) echo "obd survey finished in $rtime seconds" - check_jbd_values_facets $(get_facets OST) 4 $rtime || rc=$((rc+$?)) - restore_lustre_params < $param_file rm -f $param_file - return $rc } run_test 1b "Object Storage Targets survey, async journal" @@ -192,12 +141,9 @@ test_2b () { local rtime=$((etime - stime)) echo "obd survey finished in $rtime seconds" - check_jbd_values_facets $(get_facets OST) 4 $rtime || rc=$((rc+$?)) - restore_lustre_params < $param_file rm -f $param_file - return $rc } run_test 2b "Stripe F/S over the Network, async journal" -- 1.8.3.1