From: Yafang Shao <laoar.shao@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Song Liu <songliubraving@fb.com>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
yoshfuji@linux-ipv6.org, Steven Rostedt <rostedt@goodmis.org>,
Brendan Gregg <bgregg@netflix.com>,
netdev@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint
Date: Fri, 8 Dec 2017 23:50:44 +0800 [thread overview]
Message-ID: <CALOAHbDNSaHqeQCSeNMfT7udN32VEciZA0bHgtt=coeXr4xj+g@mail.gmail.com> (raw)
In-Reply-To: <20171208.104256.1026704308758536035.davem@davemloft.net>
2017-12-08 23:42 GMT+08:00 David Miller <davem@davemloft.net>:
> From: Yafang Shao <laoar.shao@gmail.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
next prev parent reply other threads:[~2017-12-08 15:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 14:10 [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint Yafang Shao
2017-12-07 20:02 ` Marcelo Ricardo Leitner
2017-12-07 20:04 ` David Miller
2017-12-08 1:41 ` Yafang Shao
2017-12-08 3:40 ` Yafang Shao
2017-12-08 11:03 ` Marcelo Ricardo Leitner
2017-12-08 16:03 ` David Miller
2017-12-08 15:42 ` David Miller
2017-12-08 15:50 ` Yafang Shao [this message]
2017-12-08 16:28 ` David Miller
2017-12-09 0:47 ` Yafang Shao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALOAHbDNSaHqeQCSeNMfT7udN32VEciZA0bHgtt=coeXr4xj+g@mail.gmail.com' \
--to=laoar.shao@gmail.com \
--cc=bgregg@netflix.com \
--cc=davem@davemloft.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=songliubraving@fb.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).