All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Ira Weiny <ira.weiny@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-efi@vger.kernel.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH 2/2] cxl/trace: Remove unnecessary memcpy's
Date: Wed, 31 Jan 2024 17:17:55 -0800	[thread overview]
Message-ID: <ZbrxQ+FehE6nq9w5@aschofie-mobl2> (raw)
In-Reply-To: <20240131-cxl-cper-fixups-v1-2-335c85b1d77b@intel.com>

On Wed, Jan 31, 2024 at 03:55:39PM -0800, Ira Weiny wrote:
> CPER events don't have UUIDs.  Therefore UUIDs were removed from the
> records passed to trace events and replaced with hard coded values.
> 
> As pointed out by Jonathan, the new defines for the UUIDs present a more
> efficient way to assign UUID in trace records.[1]
> 
> Replace memcpy's with the use of static data.

Reviewed-by: Alison Schofield <alison.schofield@intel.com>


> 
> [1] https://lore.kernel.org/all/20240108132325.00000e9c@Huawei.com/
> 
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> ---
>  drivers/cxl/core/trace.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
> index 89445435303a..bdf117a33744 100644
> --- a/drivers/cxl/core/trace.h
> +++ b/drivers/cxl/core/trace.h
> @@ -338,7 +338,7 @@ TRACE_EVENT(cxl_general_media,
>  
>  	TP_fast_assign(
>  		CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr);
> -		memcpy(&__entry->hdr_uuid, &CXL_EVENT_GEN_MEDIA_UUID, sizeof(uuid_t));
> +		__entry->hdr_uuid = CXL_EVENT_GEN_MEDIA_UUID;
>  
>  		/* General Media */
>  		__entry->dpa = le64_to_cpu(rec->phys_addr);
> @@ -425,7 +425,7 @@ TRACE_EVENT(cxl_dram,
>  
>  	TP_fast_assign(
>  		CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr);
> -		memcpy(&__entry->hdr_uuid, &CXL_EVENT_DRAM_UUID, sizeof(uuid_t));
> +		__entry->hdr_uuid = CXL_EVENT_DRAM_UUID;
>  
>  		/* DRAM */
>  		__entry->dpa = le64_to_cpu(rec->phys_addr);
> @@ -573,7 +573,7 @@ TRACE_EVENT(cxl_memory_module,
>  
>  	TP_fast_assign(
>  		CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr);
> -		memcpy(&__entry->hdr_uuid, &CXL_EVENT_MEM_MODULE_UUID, sizeof(uuid_t));
> +		__entry->hdr_uuid = CXL_EVENT_MEM_MODULE_UUID;
>  
>  		/* Memory Module Event */
>  		__entry->event_type = rec->event_type;
> 
> -- 
> 2.43.0
> 

  reply	other threads:[~2024-02-01  1:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 23:55 [PATCH 0/2] cxl/cper: Fixes for CXL CPER event processing Ira Weiny
2024-01-31 23:55 ` [PATCH 1/2] cxl/cper: Fix errant CPER prints for CXL events Ira Weiny
2024-02-01  1:17   ` Alison Schofield
2024-02-01 11:22     ` Jonathan Cameron
2024-02-01 16:15   ` Dave Jiang
2024-01-31 23:55 ` [PATCH 2/2] cxl/trace: Remove unnecessary memcpy's Ira Weiny
2024-02-01  1:17   ` Alison Schofield [this message]
2024-02-01 11:23     ` Jonathan Cameron
2024-02-01 16:16   ` Dave Jiang
2024-02-03 17:31 ` [PATCH 0/2] cxl/cper: Fixes for CXL CPER event processing Ard Biesheuvel

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=ZbrxQ+FehE6nq9w5@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.