[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoCkvNmC6iFjuG90--3jBp=VD6BfQC5LBEGr4M=SvT-aEA@mail.gmail.com>
Date: Wed, 10 Apr 2024 00:09:40 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
dsahern@...nel.org, matttbe@...nel.org, martineau@...nel.org,
geliang@...nel.org, mptcp@...ts.linux.dev, linux-trace-kernel@...r.kernel.org,
netdev@...r.kernel.org, Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next v3 6/6] rstreason: make it work in trace world
Hi Steven,
On Tue, Apr 9, 2024 at 11:36 PM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> On Tue, 9 Apr 2024 18:09:34 +0800
> Jason Xing <kerneljasonxing@...il.com> wrote:
>
> > /*
> > * tcp event with arguments sk and skb
> > @@ -74,20 +75,38 @@ DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb,
> > TP_ARGS(sk, skb)
> > );
> >
> > +#undef FN1
> > +#define FN1(reason) TRACE_DEFINE_ENUM(SK_RST_REASON_##reason);
> > +#undef FN2
> > +#define FN2(reason) TRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason);
> > +DEFINE_RST_REASON(FN1, FN1)
>
> Interesting. I've never seen the passing of the internal macros to the main
> macro before. I see that you are using it for handling both the
> SK_RST_REASON and the SK_DROP_REASON.
Yes, I want to cover two kinds of reasons and then strip them of
prefixes which can be reported to userspace.
>
> > +
> > +#undef FN1
> > +#undef FNe1
> > +#define FN1(reason) { SK_RST_REASON_##reason, #reason },
> > +#define FNe1(reason) { SK_RST_REASON_##reason, #reason }
> > +
> > +#undef FN2
> > +#undef FNe2
> > +#define FN2(reason) { SKB_DROP_REASON_##reason, #reason },
> > +#define FNe2(reason) { SKB_DROP_REASON_##reason, #reason }
>
> Anyway, from a tracing point of view, as it looks like it would work
> (I haven't tested it).
Sure, it works. One simple test if you're interested:
1) Apply this patchset locally
2) add 'trace_tcp_send_reset(sk, skb, [one reason])' in the receive
path, say, somewhere in the tcp_v4_rcv()
The possible result can be seen in the cover letter. I list here:
<idle>-0 [002] ..s1. 1830.262425: tcp_send_reset: skbaddr=x
skaddr=x src=x dest=x state=x reason=NOT_SPECIFIED
<idle>-0 [002] ..s1. 1830.262425: tcp_send_reset: skbaddr=x
skaddr=x src=x dest=x state=x reason=NO_SOCKET
>
> Reviewed-by: Steven Rostedt (Google) <rostedt@...dmis.org>
Thanks!
>
> -- Steve
Powered by blists - more mailing lists