Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751571AbdF0OMI (ORCPT ); Tue, 27 Jun 2017 10:12:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:35676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbdF0OMC (ORCPT ); Tue, 27 Jun 2017 10:12:02 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AAF7217C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 27 Jun 2017 10:11:58 -0400 From: Steven Rostedt To: Xie XiuQi Cc: , , , , , , , , , , Subject: Re: [PATCH v5] trace: ras: add ARM processor error information trace event Message-ID: <20170627101158.517f329c@gandalf.local.home> In-Reply-To: <918253cf-33ef-3152-a492-14f2b8946e99@huawei.com> References: <1498275503-137890-1-git-send-email-xiexiuqi@huawei.com> <20170626093624.381a25cb@gandalf.local.home> <918253cf-33ef-3152-a492-14f2b8946e99@huawei.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3062 Lines: 88 On Tue, 27 Jun 2017 10:41:34 +0800 Xie XiuQi wrote: > Hi Steve, > > Thanks for your comments. > > On 2017/6/26 21:36, Steven Rostedt wrote: > > On Sat, 24 Jun 2017 11:38:23 +0800 > > Xie XiuQi wrote: > > > >> diff --git a/include/linux/cper.h b/include/linux/cper.h > >> index 4c671fc..17546bf 100644 > >> --- a/include/linux/cper.h > >> +++ b/include/linux/cper.h > >> @@ -275,6 +275,11 @@ enum { > >> #define CPER_ARM_INFO_FLAGS_PROPAGATED BIT(2) > >> #define CPER_ARM_INFO_FLAGS_OVERFLOW BIT(3) > >> > >> +#define CPER_ARM_INFO_TYPE_CACHE 0 > >> +#define CPER_ARM_INFO_TYPE_TLB 1 > >> +#define CPER_ARM_INFO_TYPE_BUS 2 > >> +#define CPER_ARM_INFO_TYPE_UARCH 3 > >> + > >> /* > >> * All tables and structs must be byte-packed to match CPER > >> * specification, since the tables are provided by the system BIOS > >> diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h > >> index 429f46f..dd91ba8 100644 > >> --- a/include/ras/ras_event.h > >> +++ b/include/ras/ras_event.h > >> @@ -206,6 +206,85 @@ > >> __entry->running_state, __entry->psci_state) > >> ); > >> > >> +#define ARM_PROC_ERR_TYPE \ > >> + EM ( CPER_ARM_INFO_TYPE_CACHE, "cache error" ) \ > >> + EM ( CPER_ARM_INFO_TYPE_TLB, "TLB error" ) \ > >> + EM ( CPER_ARM_INFO_TYPE_BUS, "bus error" ) \ > >> + EMe ( CPER_ARM_INFO_TYPE_UARCH, "micro-architectural error" ) > > > > These are all defines. As the name suggests, the TRACE_DEFINE_ENUM() is > > for use with enums, not defines. You can nuke this part. > > > >> + > >> +/* > >> + * First define the enums in MM_ACTION_RESULT to be exported to userspace > >> + * via TRACE_DEFINE_ENUM(). > >> + */ > >> +#undef EM > >> +#undef EMe > >> +#define EM(a, b) TRACE_DEFINE_ENUM(a); > >> +#define EMe(a, b) TRACE_DEFINE_ENUM(a); > >> + > >> +ARM_PROC_ERR_TYPE > >> + > >> +/* > >> + * Now redefine the EM() and EMe() macros to map the enums to the strings > >> + * that will be printed in the output. > >> + */ > >> +#undef EM > >> +#undef EMe > >> +#define EM(a, b) { a, b }, > >> +#define EMe(a, b) { a, b } > > > > All the EM* and friends above are not needed. The macro below will > > translate into numbers not names in the format files in tracefs. > > So, do you mean we just use __print_symbolic like below: > > #define show_proc_err_type(type) \ > __print_symbolic(type, \ > { CPER_ARM_INFO_TYPE_CACHE, "cache error" }, \ > { CPER_ARM_INFO_TYPE_TLB, "TLB error" }, \ > { CPER_ARM_INFO_TYPE_BUS, "bus error" }, \ > { CPER_ARM_INFO_TYPE_UARCH, "micro-architectural error" }) > > > Correct. If you want to make sure, just boot the kernel and look at the format file within the tracepoint: /sys/kernel/debug/tracing/events/ras/arm_err_info_event/format And make sure there's no constant names there. -- Steve