Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750971AbdLaDHI (ORCPT ); Sat, 30 Dec 2017 22:07:08 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:45956 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbdLaDHG (ORCPT ); Sat, 30 Dec 2017 22:07:06 -0500 X-Google-Smtp-Source: ACJfBosGu+cZ7h0mHxrFnJsjeG791vjb1lVBs2/roKJuorokg2d3SJ68hhwzVLY00R+Y8amAjfaEwzBlVR7Ze/XxsKQ= MIME-Version: 1.0 In-Reply-To: References: <1513739574-3345-1-git-send-email-laoar.shao@gmail.com> <1513739574-3345-3-git-send-email-laoar.shao@gmail.com> From: Yafang Shao Date: Sun, 31 Dec 2017 11:06:25 +0800 Message-ID: Subject: Re: [PATCH v3 net-next 2/5] net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint To: Brendan Gregg Cc: Song Liu , "David S. Miller" , Marcelo Ricardo Leitner , Steven Rostedt , Brendan Gregg , netdev@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1518 Lines: 35 On Sun, Dec 31, 2017 at 6:33 AM, Brendan Gregg wrote: > On Tue, Dec 19, 2017 at 7:12 PM, Yafang Shao wrote: >> As sk_state is a common field for struct sock, so the state >> transition tracepoint should not be a TCP specific feature. >> Currently it traces all AF_INET state transition, so I rename this >> tracepoint to inet_sock_set_state tracepoint with some minor changes and move it >> into trace/events/sock.h. > > The tcp:tcp_set_state probe is tcp_set_state(), so it's only going to > fire for TCP sessions. It's not broken, and we could add a > sctp:sctp_set_state as well. Replacing tcp:tcp_set_state with > inet_sk_set_state is feeling like we might be baking too much > implementation detail into the tracepoint API. > > If we must have inet_sk_set_state, then must we also delete tcp:tcp_set_state? > Hi Brendan, The reason we have to make this change could be got from this mail thread, https://patchwork.kernel.org/patch/10099243/ . The original tcp:tcp_set_state probe doesn't traced all TCP state transitions. There're some state transitions in inet_connection_sock.c and inet_hashtables.c are missed. So we have to place this probe into these two files to fix the issue. But as inet_connection_sock.c and inet_hashtables.c are common files for all IPv4 protocols, not only for TCP, so it is not proper to place a tcp_ function in these two files. That's why we decide to rename tcp:tcp_set_state probe to sock:inet_sock_set_state. Thanks Yafang