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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8E88ECAAD3 for ; Mon, 5 Sep 2022 14:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238547AbiIEOk3 (ORCPT ); Mon, 5 Sep 2022 10:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238536AbiIEOj6 (ORCPT ); Mon, 5 Sep 2022 10:39:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432FB5D12D; Mon, 5 Sep 2022 07:37:36 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7B1BCB81148; Mon, 5 Sep 2022 14:37:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D51EC433D6; Mon, 5 Sep 2022 14:37:31 +0000 (UTC) Date: Mon, 5 Sep 2022 10:38:08 -0400 From: Steven Rostedt To: Eric Dumazet Cc: Menglong Dong , Jakub Kicinski , David Miller , Paolo Abeni , Ingo Molnar , Menglong Dong , David Ahern , Hao Peng , Dongli Zhang , robh@kernel.org, Pavel Begunkov , Luiz Augusto von Dentz , Vasily Averin , LKML , netdev Subject: Re: [PATCH net-next v2] net: skb: export skb drop reaons to user by TRACE_DEFINE_ENUM Message-ID: <20220905103808.434f6909@gandalf.local.home> In-Reply-To: References: <20220902141715.1038615-1-imagedong@tencent.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: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2 Sep 2022 08:43:07 -0700 Eric Dumazet wrote: > > --- > > v2: > > - undef FN/FNe after use it (Jakub Kicinski) > > I would love some feedback from Steven :) The undef should be fine. I usually do not, but that's more of a preference than a rule. As long as the undef is done after the C portion of where the macro is used: +#undef FN +#define FN(reason) TRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason); +DEFINE_DROP_REASON(FN, FN) <<<--- C portion +#undef FN +#undef FNe +#define FN(reason) { SKB_DROP_REASON_##reason, #reason }, +#define FNe(reason) { SKB_DROP_REASON_##reason, #reason } + /* * Tracepoint for free an sk_buff: */ @@ -35,9 +44,13 @@ TRACE_EVENT(kfree_skb, TP_printk("skbaddr=%p protocol=%u location=%p reason: %s", __entry->skbaddr, __entry->protocol, __entry->location, - drop_reasons[__entry->reason]) + __print_symbolic(__entry->reason, + DEFINE_DROP_REASON(FN, FNe))) <<<--- C portion ); +#undef FN +#undef FNe So for this part: Reviewed-by: Steven Rostedt (Google) -- Steve