From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54DE8C433E6 for ; Fri, 26 Feb 2021 14:04:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BAD9764F03 for ; Fri, 26 Feb 2021 14:04:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAD9764F03 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B8696B0005; Fri, 26 Feb 2021 09:04:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0691A6B0006; Fri, 26 Feb 2021 09:04:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E71976B006C; Fri, 26 Feb 2021 09:04:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id CFB886B0005 for ; Fri, 26 Feb 2021 09:04:04 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8FF2BBF02 for ; Fri, 26 Feb 2021 14:04:04 +0000 (UTC) X-FDA: 77860588008.09.B165B86 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf29.hostedemail.com (Postfix) with ESMTP id D97312BD6 for ; Fri, 26 Feb 2021 14:04:00 +0000 (UTC) Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E421564EED; Fri, 26 Feb 2021 14:03:56 +0000 (UTC) Date: Fri, 26 Feb 2021 09:03:55 -0500 From: Steven Rostedt To: Andrew Morton Cc: andreyknvl@google.com, dvyukov@google.com, elver@google.com, glider@google.com, gregkh@linuxfoundation.org, linux-mm@kvack.org, mingo@redhat.com, mm-commits@vger.kernel.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, torvalds@linux-foundation.org, vbabka@suse.cz Subject: Re: [patch 067/118] tracing: add error_report_end trace point Message-ID: <20210226090355.227d689e@gandalf.local.home> In-Reply-To: <20210226011944.aSSBVuJAj%akpm@linux-foundation.org> References: <20210225171452.713967e96554bb6a53e44a19@linux-foundation.org> <20210226011944.aSSBVuJAj%akpm@linux-foundation.org> 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: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D97312BD6 X-Stat-Signature: z3bf5xpowcec4n49b4u8eny6dfnbwoy6 Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf29; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: none/none X-HE-Tag: 1614348240-320930 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 25 Feb 2021 17:19:44 -0800 Andrew Morton wrote: > +#define show_error_detector_list(val) \ > + __print_symbolic(val, error_detector_list) > + > +DECLARE_EVENT_CLASS(error_report_template, > + TP_PROTO(enum error_detector error_detector, unsigned long id), > + TP_ARGS(error_detector, id), > + TP_STRUCT__entry(__field(enum error_detector, error_detector) > + __field(unsigned long, id)), > + TP_fast_assign(__entry->error_detector = error_detector; > + __entry->id = id;), > + TP_printk("[%s] %lx", > + show_error_detector_list(__entry->error_detector), > + __entry->id)); > + > +/** This doesn't need to change right now, but FYI, do not follow checkpatch formatting for TRACE_EVENT() and friend macros. The above is really hard to read for a trace event. It should look like this: DECLARE_EVENT_CLASS(error_report_template, TP_PROTO(enum error_detector error_detector, unsigned long id), TP_ARGS(error_detector, id), TP_STRUCT__entry( __field(enum error_detector, error_detector) __field(unsigned long, id) ), TP_fast_assign( __entry->error_detector = error_detector; __entry->id = id; ), TP_printk("[%s] %lx", show_error_detector_list(__entry->error_detector), __entry->id) ); As it's not really a macro, but code, and see, it's MUCH easier to read! Because we see the prototype, the structure definition, the code that assigns that structure, and how to print it. Following what checkpatch says, is equivalent to writing code like this: void trace_error_report_template (enum error_detector error_detector, unsigned long id) { struct entry {enum error_detector error_detector; unsigned long id;}; __entry->error_detector = error_detector; __entry->id = id; printk("[%s] %lx", show_error_detector_list(__entry->error_detector), __entry->id)); } It doesn't need to be fixed now. I'll try to remember to fix it after it lands in my tree. -- Steve