From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F1A9C4332F for ; Mon, 7 Nov 2022 22:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232258AbiKGW5X (ORCPT ); Mon, 7 Nov 2022 17:57:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232950AbiKGW5C (ORCPT ); Mon, 7 Nov 2022 17:57:02 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C4953137E for ; Mon, 7 Nov 2022 14:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667861747; x=1699397747; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BN5/PiaNIWFamosoHFOxCQGmhFrm+Yv35c9GGAFSA+I=; b=DIsSDtFjRtp2mM5h0+Y9Csc56EjN9wK6gI0OBFblps5iRydILe1WVTBB 8NtHE0AjNm9NcTIMulhMbmdg7A158UEdsyyp76RItDFzPlSe7d70VQBvg FwBflPcJHDHjH/DN7W3WlWRi9LmBCBjYqcT4HTDCwBiXeTe+gYdpzhhCM umiazn7elScSgX3ms1dMslmb8vJ/1Z3hBHIXBFIZmYOQoIDyFE6i42eu9 na6dhh+B/A86tTud1Q7oeS9txzrWD5YD1bGVdo+adHE3oOHDZYLxbsymq d3iHf2FycdaZIofnvdZRGIO4X7zL+XUGHZmds483EIC7jUsL5EzrISLyU A==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="308167057" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="308167057" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 14:55:44 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="761268852" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="761268852" Received: from aschofie-mobl2.amr.corp.intel.com (HELO aschofie-mobl2) ([10.209.100.77]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 14:55:43 -0800 Date: Mon, 7 Nov 2022 14:55:42 -0800 From: Alison Schofield To: Dan Williams Cc: vishal.l.verma@intel.com, linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev Subject: Re: [ndctl PATCH 02/15] ndctl/test: Add kernel backtrace detection to some dax tests Message-ID: References: <166777840496.1238089.5601286140872803173.stgit@dwillia2-xfh.jf.intel.com> <166777841716.1238089.7618196736080256393.stgit@dwillia2-xfh.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166777841716.1238089.7618196736080256393.stgit@dwillia2-xfh.jf.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org On Sun, Nov 06, 2022 at 03:46:57PM -0800, Dan Williams wrote: > It is useful to fail a test if it triggers a backtrace. Generalize the > mechanism from test/cxl-topology.sh and add it to tests that want > to validate clean kernel logs. Useful! Reviewed-by: Alison Schofield > > Signed-off-by: Dan Williams > --- > test/common | 10 ++++++++++ > test/cxl-region-sysfs.sh | 4 +--- > test/cxl-topology.sh | 5 +---- > test/dax.sh | 2 ++ > test/daxdev-errors.sh | 2 ++ > test/multi-dax.sh | 2 ++ > 6 files changed, 18 insertions(+), 7 deletions(-) > > diff --git a/test/common b/test/common > index 65615cc09a3e..44cc352f6009 100644 > --- a/test/common > +++ b/test/common > @@ -132,3 +132,13 @@ json2var() > { > sed -e "s/[{}\",]//g; s/\[//g; s/\]//g; s/:/=/g" > } > + > +# check_dmesg > +# $1: line number where this is called > +check_dmesg() > +{ > + # validate no WARN or lockdep report during the run > + log=$(journalctl -r -k --since "-$((SECONDS+1))s") > + grep -q "Call Trace" <<< $log && err $1 > + true > +} > diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh > index 63186b60dfec..e128406cd8c8 100644 > --- a/test/cxl-region-sysfs.sh > +++ b/test/cxl-region-sysfs.sh > @@ -164,8 +164,6 @@ readarray -t endpoint < <($CXL free-dpa -t pmem ${mem[*]} | > jq -r ".[] | .decoder.decoder") > echo "$region released ${#endpoint[@]} targets: ${endpoint[@]}" > > -# validate no WARN or lockdep report during the run > -log=$(journalctl -r -k --since "-$((SECONDS+1))s") > -grep -q "Call Trace" <<< $log && err "$LINENO" > +check_dmesg "$LINENO" > > modprobe -r cxl_test > diff --git a/test/cxl-topology.sh b/test/cxl-topology.sh > index f7e390d22680..1f15d29f0600 100644 > --- a/test/cxl-topology.sh > +++ b/test/cxl-topology.sh > @@ -169,9 +169,6 @@ done > # validate that the bus can be disabled without issue > $CXL disable-bus $root -f > > - > -# validate no WARN or lockdep report during the run > -log=$(journalctl -r -k --since "-$((SECONDS+1))s") > -grep -q "Call Trace" <<< $log && err "$LINENO" > +check_dmesg "$LINENO" > > modprobe -r cxl_test > diff --git a/test/dax.sh b/test/dax.sh > index bb9848b10ecc..3ffbc8079eba 100755 > --- a/test/dax.sh > +++ b/test/dax.sh > @@ -118,4 +118,6 @@ else > run_xfs > fi > > +check_dmesg "$LINENO" > + > exit 0 > diff --git a/test/daxdev-errors.sh b/test/daxdev-errors.sh > index 7f79718113d0..84ef93499acf 100755 > --- a/test/daxdev-errors.sh > +++ b/test/daxdev-errors.sh > @@ -71,6 +71,8 @@ if read sector len < /sys/bus/platform/devices/nfit_test.0/$busdev/$region/badbl > fi > [ -n "$sector" ] && echo "fail: $LINENO" && exit 1 > > +check_dmesg "$LINENO" > + > _cleanup > > exit 0 > diff --git a/test/multi-dax.sh b/test/multi-dax.sh > index 04070adb18e4..d471e1c96b5e 100755 > --- a/test/multi-dax.sh > +++ b/test/multi-dax.sh > @@ -28,6 +28,8 @@ chardev1=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices > json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a $ALIGN_SIZE -s 16M) > chardev2=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev") > > +check_dmesg "$LINENO" > + > _cleanup > > exit 0 >