[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+qp=gmhx_1b+=hEiHA7yNGkfh46YPKhUc9GFbtNYBZrA@mail.gmail.com>
Date: Thu, 27 Oct 2022 08:32:02 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Menglong Dong <menglong8.dong@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Menglong Dong <imagedong@...cent.com>,
David Ahern <dsahern@...nel.org>,
Hao Peng <flyingpeng@...cent.com>,
Dongli Zhang <dongli.zhang@...cle.com>, robh@...nel.org,
Pavel Begunkov <asml.silence@...il.com>,
Luiz Augusto von Dentz <luiz.von.dentz@...el.com>,
Vasily Averin <vasily.averin@...ux.dev>,
LKML <linux-kernel@...r.kernel.org>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2] net: skb: export skb drop reaons to user by TRACE_DEFINE_ENUM
On Mon, Sep 5, 2022 at 7:37 AM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> On Fri, 2 Sep 2022 08:43:07 -0700
> Eric Dumazet <edumazet@...gle.com> 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) <rostedt@...dmis.org>
>
> -- Steve
This seems broken again (tried on latest net-next tree)
perf script
sshd 12192 [006] 200.090602: skb:kfree_skb:
skbaddr=0x2fa000400000 protocol=7844 location=0x2fa000001ea4 reason:
swapper 0 [030] 200.497468: skb:kfree_skb:
skbaddr=0xba00400001 protocol=65535 location=0x9080c62800000000
reason:
kworker/30:1-ev 308 [030] 200.497476: skb:kfree_skb:
skbaddr=0xba00400001 protocol=65535 location=0x9080c62800000000
reason:
swapper 0 [009] 200.957881: skb:kfree_skb:
skbaddr=0x2fa400400000 protocol=12195 location=0x2fa400002fa3 reason:
swapper 0 [026] 201.515769: skb:kfree_skb:
skbaddr=0xb600400001 protocol=65535 location=0x9080c62800000000
reason:
kworker/26:1-mm 276 [026] 201.515797: skb:kfree_skb:
skbaddr=0xb600400001 protocol=65535 location=0x9080c62800000000
reason:
kworker/26:1-mm 276 [026] 201.515802: skb:kfree_skb:
skbaddr=0x2f9f00400000 protocol=12189 location=0x2f9f00002f9d reason:
swapper 0 [030] 201.521484: skb:kfree_skb:
skbaddr=0xba00400001 protocol=65535 location=0x9080c62800000000
reason:
kworker/30:1-ev 308 [030] 201.521491: skb:kfree_skb:
skbaddr=0x2fa100400000 protocol=12192 location=0x2fa100002fa0 reason:
Powered by blists - more mailing lists