[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALOAHbDNSaHqeQCSeNMfT7udN32VEciZA0bHgtt=coeXr4xj+g@mail.gmail.com>
Date: Fri, 8 Dec 2017 23:50:44 +0800
From: Yafang Shao <laoar.shao@...il.com>
To: David Miller <davem@...emloft.net>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
Song Liu <songliubraving@...com>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
yoshfuji@...ux-ipv6.org, Steven Rostedt <rostedt@...dmis.org>,
Brendan Gregg <bgregg@...flix.com>, netdev@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition
with tcp_set_state tracepoint
2017-12-08 23:42 GMT+08:00 David Miller <davem@...emloft.net>:
> From: Yafang Shao <laoar.shao@...il.com>
> Date: Fri, 8 Dec 2017 11:40:23 +0800
>
>> It will looks like these,
>>
>> if (sk->sk_protocol == IPPROTO_TCP)
>> __tcp_set_state(newsk, TCP_SYN_RECV);
>> else
>> newsk->sk_state = TCP_SYN_RECV;
>>
>>
>> if (sk->sk_protocol == IPPROTO_TCP)
>> __tcp_set_state(sk, TCP_CLOSE);
>> else
>> sk->sk_state = TCP_CLOSE;
>>
>> if (sk->sk_protocol == IPPROTO_TCP)
>> tcp_state_store(sk, state);
>> else
>> sk_state_store(sk, state);
>>
>>
>> Some redundant code.
>>
>> IMO, put these similar code into a wrapper is more nice.
>
> I think this discussion and how ugly this is getting shows that
> tracing the state transitions of a socket is perhaps not best as a TCP
> specific feature.
Do you mean that tcp_set_state tracepoint should be replaced with
sk_set_state tracepoint and move that tracepoint to
trace/events/sock.h ?
Thanks
Yafang
Powered by blists - more mailing lists