Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1016392rdd; Wed, 10 Jan 2024 06:22:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGG0AknqyjxBmGO5CCIn4Axt5P49UDRHVZw6UlsmahqVhRR6QN3rqP5IDEBcZigYs1jIyzI X-Received: by 2002:a17:90a:9ee:b0:28c:f5a2:9a69 with SMTP id 101-20020a17090a09ee00b0028cf5a29a69mr809372pjo.44.1704896550107; Wed, 10 Jan 2024 06:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704896550; cv=none; d=google.com; s=arc-20160816; b=NesMxlIWHGyFJVZ+QOoklwhe8NaSxbp2/pkvzIUKYu2KiGoC2VTzKswR4WiWFgrU7C oOPtlzfM3IlzU7N12SAKNaZsZoEUWeodGkCQGrOp28Dc5CzAs/2M9aU9iT7heInQDf5Y LcweACGwwIesLvVEVf+S5avttp8hkTXZpgisWx5xQ75QcD6q8EhwFI1yUCjQjcEvkD/v pW1DICVReCafghYLvPcVwxcYxCgEI4QuRX6RUfWavecQVqLKOcihsVKJDDnhk+fFcPmV Z4Ao4yAwL0JQvfOLeqKEjBs9Zjo6bMJzJNSEr++3UoQWEaAYhGoGaoAsD3c1f+Zd3i/Q z55A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=a4zYAprCZ66CR2jQnRxF1wLeUz56/CZ/J/3HUmID374=; fh=ic6eKNjTnDhAF2CMNCaFsAYklE78c67vfcL56aAM1Fw=; b=D/Y7lfRg55J9PunNWdonOBB8j4YzAlDCMO4vq+JHyWIYqG7GRBf7785mdHs/v/tBND MOkKknhbxWkpiBnRtK+bf8G9wesNilQYrpO0Wnh/n2ugSLw4AM9vrvLJbSOsozLlqK19 StWJfq57tQe/jf3ddRxdGHpMagJqNus5gnUbbv46yb/l5iGDMItYTOsrqksl4KsBx1sH y61fYbbFLvyJ+iWmMmAe/xt3LwTg7GIMkQ2TGRwLjv5ilRrJcHD0BQ1MwnwIobVDBXZB 8oemvsxLpfb9+MiKPWD2hlKsEI52/XmxarOsTXbnFlfNgf5kgchgmFpdg3zYCJTTBANO W9Tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22348-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p7-20020a17090ab90700b0028c934a2e8bsi1524783pjr.79.2024.01.10.06.22.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 06:22:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22348-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22348-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.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 E25222814FB for ; Wed, 10 Jan 2024 14:22:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65B8C4A9AD; Wed, 10 Jan 2024 14:22:15 +0000 (UTC) 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 CFC824B5A1; Wed, 10 Jan 2024 14:22:09 +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.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4T990f3nsfz6K977; Wed, 10 Jan 2024 22:19:30 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 78450140B38; Wed, 10 Jan 2024 22:22:06 +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; Wed, 10 Jan 2024 14:22:05 +0000 Date: Wed, 10 Jan 2024 14:22:05 +0000 From: Jonathan Cameron To: Dan Williams CC: Ira Weiny , 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: <20240110142205.0000164e@Huawei.com> In-Reply-To: <659dd8f467dbe_5cee29456@dwillia2-xfh.jf.intel.com.notmuch> References: <20231220-cxl-cper-v5-0-1bb8a4ca2c7a@intel.com> <20231220-cxl-cper-v5-4-1bb8a4ca2c7a@intel.com> <20240108132325.00000e9c@Huawei.com> <659dd8f467dbe_5cee29456@dwillia2-xfh.jf.intel.com.notmuch> 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: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500005.china.huawei.com (7.191.163.240) On Tue, 9 Jan 2024 15:38:28 -0800 Dan Williams wrote: > Jonathan Cameron wrote: > > 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. > > We can follow on with this conversion later as I see other usage of uuid > copying in trace events (bcache for instance). Although I probably would > not replace it with straight assignment and instead use the uuid_copy() > helper. Otherwise, why do {uuid,guid}_copy() helpers exist? To copy unknown uuids and guids where the compiler can't optimize things nearly as well because it can't see the values. Jonathan