Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp43882iog; Tue, 14 Jun 2022 18:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfVN9gKPMYeLk9GLvSgV7ppxZcSVvgfqbH2mqqmTqQupe6163OHDg+tiEty7HR01fwzUln X-Received: by 2002:a65:588b:0:b0:3fe:4237:2ee5 with SMTP id d11-20020a65588b000000b003fe42372ee5mr6850948pgu.442.1655256725426; Tue, 14 Jun 2022 18:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655256725; cv=none; d=google.com; s=arc-20160816; b=uBsLFt4W0TswBqry4Rij4CuiZhOwhubcSRxsuic1cx2bSUUXrfsogYCbqCeu8j/KOe CQ/ogOvXPPZt9EW15m+rkzgg9pmbl3OdbrdIrqsJ3O9l1hBAtVWWngkTQ2OG8sieA68T 00ejSVVsrThPQeJfWm9jhv+KKJD+Zc0R6W0cr05/30NwLh6DGAp4f4SZJlhKB+G/96G4 abSpHBa3G1Zbupo4it3BlZMzGPtJE9oRSyaj+ZT0Be/4FVHAR71in+6lpmtaNtfp+HMy PGXhc8FUp2WdHEVnewSlnXRPs+7yvVCLh7y7bXvo1OuSLpnkagwoat9BA4UCv3uZ0rkH a7MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=17ck/a9OGYSHW5ZoGeiJAgwx8nmAsaZcPj3FGlxlaJU=; b=O+2cw81rBxTLmPJgkwpY9FXoX/jdsKLQ9SRUAs3ExLFEc+NA5xwzQw1b+omBJnb7G3 w5wij/veJsukYx3FmEpHOrobSbPK/M4YYIBOC4fpBHu2DpXRQVyiu446LadL0AFhMu+c xJuu3IPIh1MCMQJXCDScM8eh8sYkNwDQtGs5qjJY7mpGYe3TAsiIzFP5lteeFqSWzC6C 1QelvSp4/l3iJ5rN/HEsKZKrSUnU6y2IEqyL41NYmccxlsBlJWBJN/Zho7sHg+fk3kM4 TTzNQ3uzYyviB+Wn23Aq9HT/CkEMtQ8qQpiJR6f0zF3T4S0jk19t1AhwJOIajFPvcUEu LmDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a170902e9d300b00168b5f745bcsi14778807plk.503.2022.06.14.18.31.51; Tue, 14 Jun 2022 18:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237733AbiFOBP4 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 14 Jun 2022 21:15:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbiFOBPz (ORCPT ); Tue, 14 Jun 2022 21:15:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9791837D; Tue, 14 Jun 2022 18:15:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DC74B6195E; Wed, 15 Jun 2022 01:15:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71EF2C3411B; Wed, 15 Jun 2022 01:15:52 +0000 (UTC) Date: Tue, 14 Jun 2022 21:15:50 -0400 From: Steven Rostedt To: alison.schofield@intel.com Cc: Dan Williams , Ira Weiny , Vishal Verma , Ben Widawsky , Ingo Molnar , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] trace, cxl: Introduce a TRACE_EVENT for CXL Poison Records Message-ID: <20220614211550.335dde60@gandalf.local.home> In-Reply-To: <32a761fe7046680a4d50762fc43988def24a4bcd.1655250669.git.alison.schofield@intel.com> References: <32a761fe7046680a4d50762fc43988def24a4bcd.1655250669.git.alison.schofield@intel.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Jun 2022 17:10:26 -0700 alison.schofield@intel.com wrote: > From: Alison Schofield > > Add a trace event for CXL Poison List Media Error Records that > includes the starting DPA of the poison, the length, and the > the source of the poison. > > This trace event will be used by the CXL_MEM driver to log the > Media Errors returned by the GET_POISON_LIST Mailbox command. > > Signed-off-by: Alison Schofield > --- > include/trace/events/cxl.h | 60 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 60 insertions(+) > create mode 100644 include/trace/events/cxl.h > > diff --git a/include/trace/events/cxl.h b/include/trace/events/cxl.h > new file mode 100644 > index 000000000000..17e707c3817e > --- /dev/null > +++ b/include/trace/events/cxl.h > @@ -0,0 +1,60 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM cxl > + > +#if !defined(_CXL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _CXL_TRACE_H > + > +#include > + > +TRACE_DEFINE_ENUM(CXL_POISON_SOURCE_UNKNOWN); > +TRACE_DEFINE_ENUM(CXL_POISON_SOURCE_INTERNAL); > +TRACE_DEFINE_ENUM(CXL_POISON_SOURCE_EXTERNAL); > +TRACE_DEFINE_ENUM(CXL_POISON_SOURCE_INJECTED); > +TRACE_DEFINE_ENUM(CXL_POISON_SOURCE_VENDOR); > +TRACE_DEFINE_ENUM(CXL_POISON_SOURCE_INVALID); > + > +#define show_poison_source(source) \ > + __print_symbolic(source, \ > + {CXL_POISON_SOURCE_UNKNOWN, "UNKNOWN"}, \ > + {CXL_POISON_SOURCE_EXTERNAL, "EXTERNAL"}, \ > + {CXL_POISON_SOURCE_INTERNAL, "INTERNAL"}, \ > + {CXL_POISON_SOURCE_INJECTED, "INJECTED"}, \ > + {CXL_POISON_SOURCE_VENDOR, "VENDOR"}, \ > + {CXL_POISON_SOURCE_INVALID, "INVALID"}) > + > +TRACE_EVENT(cxl_poison_list, > + > + TP_PROTO(struct device *dev, > + int source, > + unsigned long start, > + unsigned int length), > + > + TP_ARGS(dev, source, start, length), > + > + TP_STRUCT__entry( > + __string(name, dev_name(dev)) > + __field(int, source) > + __field(u64, start) > + __field(u32, length) OK, the above order should be fine, without adding any holes. The __string() is 4 bytes as well as the "int". Which keeps it aligned with the u64 (8 bytes), followed by a u32, which is 4 bytes. From a tracing perspective: Reviewed-by: Steven Rostedt (VMware) -- Steve > + ), > + > + TP_fast_assign( > + __assign_str(name, dev_name(dev)); > + __entry->source = source; > + __entry->start = start; > + __entry->length = length; > + ), > + > + TP_printk("dev %s source %s start %llu length %u", > + __get_str(name), > + show_poison_source(__entry->source), > + __entry->start, > + __entry->length) > +); > +#endif /* _CXL_TRACE_H */ > + > +/* This part must be outside protection */ > +#undef TRACE_INCLUDE_FILE > +#define TRACE_INCLUDE_FILE cxl > +#include