Message ID | 20240131-cxl-cper-fixups-v1-2-335c85b1d77b@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-47398-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp100917dyc; Wed, 31 Jan 2024 15:58:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhm3KcqUOmMZkU6eKEtAcduJiWYZUr/rS58pi4FIQwxULe7j9N6ZWRUEEJpnd4sNpl8u6p X-Received: by 2002:a17:90b:1956:b0:296:8a7:c556 with SMTP id nk22-20020a17090b195600b0029608a7c556mr809679pjb.49.1706745520147; Wed, 31 Jan 2024 15:58:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706745520; cv=pass; d=google.com; s=arc-20160816; b=Py/pWn47N4Egvu0ZHLPtPlm4Z1towQbZjBwbifrQvDLiC+u1NWKD9yYNRyWL3o3cOc mKsDAcJrvhxQQT72z+ByrXxLQte9zD3TFCSYOmuy/qAPQGB3qxcSML04+EvePbKvhn6v n5ZohvSybcE6FPs5882pDrDXyoS0HS8snanwUvP9sk7rlnwayi6XTWSpyV6SDiLbLz3o yUpmrBn5AktvQjuQ6B1BvIXADialCXWKN/WE4wdEp3lFNtzUlScNV3w5RGe0cOioqozd XlGc0hWuOB6SAe698bxGk0Jhpmw3i92ErHaAbLLF1X8Qa8h7lFQwSBLAE+vYW9VMiWm4 CL8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=KIWDZpdxEyYsgcV/7nRybF65N7t/0HxWq4k3yYbpwcY=; fh=TIUWXuWl/usSn91Bh6CiVWATUq6LtCtFKl4aKvB0xcg=; b=hh2Imm2w2/UKyF2wfiQQM5accgzyHObz6/XV1UPito+4A0NBoOlfb3meB2u+hWsZJ2 J2nc3GWgUEJ+G2Pbrv0AyALtXbePpIdLjvAXQ0SGmmG0wSYyi/17SH0j6GiEu24+NDMc 8bevm2IIFGc1yqsxQf6kbncRnv/LiGQTj7VM7ngBTzdo6Mpfdil/63Mq4xAT3vziakUR y/T22PaWTi2feEHOSXBP17ODeON4g5FyD+JrhZU5dZ+GT5k4JoYmhnZyvJna0/fftYnh V/rfxJc0SVPLfDKr85ySw0JRFz3Yys3cCkmDo2IF2rX+f8DMSC13SBc+wa88yS6H3Bdk j+ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mnke1NOh; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47398-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47398-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXpOyaQfT6QGH4sOTdFrI4MBJjRlNUbNYRhvAcryOOcrpvF6ZECqUe8GbhlrE6uDiRJKpr3gIg4oplxOsuLkoGJiBt3FQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w7-20020a17090abc0700b00295bc517280si1482167pjr.136.2024.01.31.15.58.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:58:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47398-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mnke1NOh; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47398-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47398-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0648F28B3CF for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 23:56:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4B683C6AB; Wed, 31 Jan 2024 23:55:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mnke1NOh" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AFD83A8F6; Wed, 31 Jan 2024 23:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706745345; cv=none; b=IlUq0fDFnuHLVYnOFZmRB15ZXDo1AZxLj/essAH+p5SVsxeEXvGaXF1jdxMU78G0b6KdI9yFbD7CAt3d4uw8a9v6nF08RPzSpX4xXghmLEPIpRgZMheZ0WOASgCN/sYuEtI3+O28Qt64DY+Rut4jsfOT7Z4q1cuoifW3yuv4J6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706745345; c=relaxed/simple; bh=jma4+rPiaW9wR5JtA9Pe7XnHL1MEBLBpNR+7EBnaMkc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p1Uxl2GTTqOMWUGd9NZPlzacND8Km++AhbzEfeGepnRG/XurG38+IvrXoYLc/+WwmPu1I4nAk0kNqa02pzFZqUesp8kqRgXyftuXB0dsQqY6bmVzBD0qI8xbK4rvGVD1v3ufjxfE+8/s8cnb1v3ZVFLHlDyFJAjoK0jR5zp9pCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mnke1NOh; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706745343; x=1738281343; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=jma4+rPiaW9wR5JtA9Pe7XnHL1MEBLBpNR+7EBnaMkc=; b=mnke1NOhGib7ujA2s5vK+Y9AHT+gda7p55vJ3uVINXpGBBiwWQBildx+ O3fDZrI1qEoaK0JiJKM1iMqDvfC0ZICWEOvPS9RNIHGwvrnt3Xt5HIVYf Qqp8DVyPMZQNOwTBVNs5lBX6QMOa+uto0WwT70MpwbZMukzcmZ0iCFxBk SOsBxueJAqs/Wx04boSvQ5bjR+B/ciZcSBncY/VJoTcc8AFYhRLNqKyBq h4FBrljyS/Az0ZiNbSwYzeL4LLGCrZC4clUeRqJDjUvzSC0srR67igXtJ z2fkmNUpEzweEsdXEoN9KQWP8hWB+u3lbUuTjlw7adRXfUVawMOgb96J+ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="3597926" X-IronPort-AV: E=Sophos;i="6.05,233,1701158400"; d="scan'208";a="3597926" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 15:55:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="822752099" X-IronPort-AV: E=Sophos;i="6.05,233,1701158400"; d="scan'208";a="822752099" Received: from iweiny-desk3.amr.corp.intel.com (HELO localhost) ([10.213.174.197]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 15:55:41 -0800 From: Ira Weiny <ira.weiny@intel.com> Date: Wed, 31 Jan 2024 15:55:39 -0800 Subject: [PATCH 2/2] cxl/trace: Remove unnecessary memcpy's Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240131-cxl-cper-fixups-v1-2-335c85b1d77b@intel.com> References: <20240131-cxl-cper-fixups-v1-0-335c85b1d77b@intel.com> In-Reply-To: <20240131-cxl-cper-fixups-v1-0-335c85b1d77b@intel.com> To: Dan Williams <dan.j.williams@intel.com>, Jonathan Cameron <jonathan.cameron@huawei.com> Cc: Davidlohr Bueso <dave@stgolabs.net>, Dave Jiang <dave.jiang@intel.com>, Alison Schofield <alison.schofield@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, Ira Weiny <ira.weiny@intel.com>, Jonathan Cameron <Jonathan.Cameron@Huawei.com> X-Mailer: b4 0.13-dev-2d940 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706745338; l=1726; i=ira.weiny@intel.com; s=20221222; h=from:subject:message-id; bh=jma4+rPiaW9wR5JtA9Pe7XnHL1MEBLBpNR+7EBnaMkc=; b=W6LLI0gVTXZoBGCHgHOW/XO2pYFZyyUiJ7Jqk4FL5Lai23kFFacC+HMr2Cf6RVfHYidxhJzuU qIdQ06cb+J5CWj2nkNte691OWsalY4SBIzewirtxsKEQsfZRK99xRC1 X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=brwqReAJklzu/xZ9FpSsMPSQ/qkSalbg6scP3w809Ec= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789652391001696477 X-GMAIL-MSGID: 1789652391001696477 |
Series |
cxl/cper: Fixes for CXL CPER event processing
|
|
Commit Message
Ira Weiny
Jan. 31, 2024, 11:55 p.m. UTC
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.
[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(-)
Comments
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 >
On Wed, 31 Jan 2024 17:17:55 -0800 Alison Schofield <alison.schofield@intel.com> wrote: > 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> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.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 > > >
On 1/31/24 16:55, 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. > > [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> Reviewed-by: Dave Jiang <dave.jiang@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; >
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;