NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
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
Date: Mon, 7 Nov 2022 14:55:42 -0800	[thread overview]
Message-ID: <Y2mM7pXOCTv4po+1@aschofie-mobl2> (raw)
In-Reply-To: <166777841716.1238089.7618196736080256393.stgit@dwillia2-xfh.jf.intel.com>

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 <alison.schofield@intel.com>

> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  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
> 

  reply	other threads:[~2022-11-07 22:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06 23:46 [ndctl PATCH 00/15] cxl-cli test and usability updates Dan Williams
2022-11-06 23:46 ` [ndctl PATCH 01/15] ndctl/test: Move firmware-update.sh to the 'descructive' set Dan Williams
2022-11-06 23:46 ` [ndctl PATCH 02/15] ndctl/test: Add kernel backtrace detection to some dax tests Dan Williams
2022-11-07 22:55   ` Alison Schofield [this message]
2022-11-06 23:47 ` [ndctl PATCH 03/15] ndctl/clang-format: Move minimum version to 6 Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 04/15] ndctl/clang-format: Fix space after for_each macros Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 05/15] cxl/list: Always attempt to collect child objects Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 06/15] cxl/list: Skip emitting pmem_size when it is zero Dan Williams
2022-11-07 20:23   ` Alison Schofield
2022-11-07 23:42     ` Dan Williams
2022-12-08  3:36     ` Dan Williams
2022-11-07 22:47   ` Alison Schofield
2022-11-07 23:51     ` Dan Williams
2022-12-08  4:14     ` Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 07/15] cxl/filter: Return json-c topology Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 08/15] cxl/list: Record cxl objects in json objects Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 09/15] cxl/region: Make ways an integer argument Dan Williams
2022-11-07 22:43   ` Alison Schofield
2022-11-07 23:50     ` Dan Williams
2022-11-08 19:36   ` Verma, Vishal L
2022-11-06 23:47 ` [ndctl PATCH 10/15] cxl/region: Make granularity " Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 11/15] cxl/region: Use cxl_filter_walk() to gather create-region targets Dan Williams
2022-11-08  8:31   ` Verma, Vishal L
2022-12-08 20:23     ` Dan Williams
2022-11-06 23:47 ` [ndctl PATCH 12/15] cxl/region: Trim region size by max available extent Dan Williams
2022-11-06 23:48 ` [ndctl PATCH 13/15] cxl/region: Default to memdev mode for create with no arguments Dan Williams
2022-11-07 20:36   ` Alison Schofield
2022-11-07 23:48     ` Dan Williams
2022-11-08 16:03       ` Alison Schofield
2022-12-08  4:09     ` Dan Williams
2022-11-06 23:48 ` [ndctl PATCH 14/15] cxl/test: Extend cxl-topology.sh for a single root-port host-bridge Dan Williams
2022-11-07 22:38   ` Alison Schofield
2022-11-08 20:23   ` Verma, Vishal L
2022-12-08 20:25     ` Dan Williams
2022-11-06 23:48 ` [ndctl PATCH 15/15] cxl/test: Test single-port host-bridge region creation Dan Williams
2022-11-07 22:36   ` Alison Schofield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y2mM7pXOCTv4po+1@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox