NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: alison.schofield@intel.com, Vishal Verma <vishal.l.verma@intel.com>
Cc: nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org
Subject: Re: [ndctl PATCH] cxl/test: Add test case for region info to cxl-events.sh
Date: Fri, 29 Mar 2024 08:38:58 -0700	[thread overview]
Message-ID: <e3f7bb27-6bcc-41d3-bf77-8458591d1fe6@intel.com> (raw)
In-Reply-To: <20240328043727.2186722-1-alison.schofield@intel.com>



On 3/27/24 9:37 PM, alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
> 
> Events cxl_general_media and cxl_dram both report DPAs that may
> be mapped in a region. If the DPA is mapped, the trace event will
> include the HPA translation, region name and region uuid in the
> trace event.
> 
> Add a test case that triggers these events with DPAs that map
> into a region. Verify the region is included in the trace event.
> 
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  test/cxl-events.sh | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/test/cxl-events.sh b/test/cxl-events.sh
> index fe702bf98ad4..ff4f3fdff1d8 100644
> --- a/test/cxl-events.sh
> +++ b/test/cxl-events.sh
> @@ -23,6 +23,26 @@ modprobe cxl_test
>  rc=1
>  
>  dev_path="/sys/bus/platform/devices"
> +trace_path="/sys/kernel/tracing"
> +
> +test_region_info()
> +{
> +	# Trigger a memdev in the cxl_test autodiscovered region
> +	region=$($CXL list  -R | jq -r ".[] | .region")
> +	memdev=$($CXL list -r "$region" --targets |
> +		jq -r '.[].mappings' |
> +		jq -r '.[0].memdev')
> +	host=$($CXL list -m "$memdev" | jq -r '.[].host')
> +
> +	echo 1 > "$dev_path"/"$host"/event_trigger
> +
> +	if ! grep "cxl_general_media.*$region" "$trace_path"/trace; then
> +		err "$LINENO"
> +	fi
> +	if ! grep "cxl_dram.*$region" "$trace_path"/trace; then
> +		err "$LINENO"
> +	fi
> +}
>  
>  test_cxl_events()
>  {
> @@ -74,6 +94,10 @@ if [ "$num_info" -ne $num_info_expected ]; then
>  	err "$LINENO"
>  fi
>  
> +echo 1 > /sys/kernel/tracing/tracing_on
> +test_region_info
> +echo 0 > /sys/kernel/tracing/tracing_on
> +
>  check_dmesg "$LINENO"
>  
>  modprobe -r cxl_test

      reply	other threads:[~2024-03-29 15:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28  4:37 [ndctl PATCH] cxl/test: Add test case for region info to cxl-events.sh alison.schofield
2024-03-29 15:38 ` Dave Jiang [this message]

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=e3f7bb27-6bcc-41d3-bf77-8458591d1fe6@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).