From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 D2FBC41760; Mon, 8 Jan 2024 13:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4T7vpK1Yzbz67vyB; Mon, 8 Jan 2024 21:21:13 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 5A1BD1400D9; Mon, 8 Jan 2024 21:23:27 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 8 Jan 2024 13:23:26 +0000 Date: Mon, 8 Jan 2024 13:23:25 +0000 From: Jonathan Cameron To: Ira Weiny CC: Dan Williams , Smita Koralahalli , Shiju Jose , Yazen Ghannam , "Davidlohr Bueso" , Dave Jiang , "Alison Schofield" , Vishal Verma , Ard Biesheuvel , , , Subject: Re: [PATCH v5 4/9] cxl/events: Remove passing a UUID to known event traces Message-ID: <20240108132325.00000e9c@Huawei.com> In-Reply-To: <20231220-cxl-cper-v5-4-1bb8a4ca2c7a@intel.com> References: <20231220-cxl-cper-v5-0-1bb8a4ca2c7a@intel.com> <20231220-cxl-cper-v5-4-1bb8a4ca2c7a@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) On Wed, 20 Dec 2023 16:17:31 -0800 Ira Weiny wrote: > The UUID data is redundant in the known event trace types. The addition > of static defines allows the trace macros to create the UUID data inside > the trace thus removing unnecessary code. > > Have well known trace events use static data to set the uuid field based > on the event type. > > Suggested-by: Jonathan Cameron > Signed-off-by: Ira Weiny > > TP_STRUCT__entry( > CXL_EVT_TP_entry > @@ -422,7 +424,8 @@ TRACE_EVENT(cxl_dram, > ), > > TP_fast_assign( > - CXL_EVT_TP_fast_assign(cxlmd, log, uuid, rec->hdr); > + CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr); > + memcpy(&__entry->hdr_uuid, &CXL_EVENT_DRAM_UUID, sizeof(uuid_t)); Hmm. Why not __entry->hdr_uuid = CXL_EVENT_DRAM_UUID; ? Compiler should be able to squish the stuff in the define down to data as as the UUID generation logic is pretty simple. I've not emulated the cper records for these yet, so not tested that works beyond compiling. J