Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4523187rwb; Tue, 8 Aug 2023 09:38:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2GDNF2/E1q0a+1CscrZvKqCdI+HZjba1f0+THnWf4pyiU1Iwd60bv4Vj3uhU6s2LX+gwR X-Received: by 2002:a17:90a:7ac8:b0:262:de1a:6028 with SMTP id b8-20020a17090a7ac800b00262de1a6028mr82185pjl.13.1691512729465; Tue, 08 Aug 2023 09:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691512729; cv=none; d=google.com; s=arc-20160816; b=wbnBBf7Be/3Y97oV+5Iv9W3EYdohCktv9bbzdJMlO7dHaogdEo5HAfPRa0X7rsNA/p RnbkgbCipIK43Ltzd9kJcf4Y3bpcQmL+GAQoW7gFuDGrkfsThEHBUOnPcrg1JutfZZLp TZU56YXwYq2c3ewwahQxutPz1/cpuyZoGLK6NeVQbbff5G8EgGcNAlJvVJgcn4HNzTHE 76XdQT0ifBqi+0F3Ge8hlfHKz1mIUxNTsq4kdeEVSaTKFtzTc1ylyY3ZyYUDu0l5MBXg zhLimnY120cWX0ahQ3nrdY2cxTXz3xhzVxh3WsN/NAvQzM664pHUHVDfCQyCHEa3CYCw DaXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=Wm7vgVpyNkBovEIVcDALXg67wDGyu9eYENE6yQjh/qo=; fh=cw538J3oiszQQMhoAiDg3Sve5aaaxfsCgMa6FCUHVUY=; b=qnCk8E/V4zp8+0tCr3JKI1TwwmPM/lq5aO/XrRT8REdO1y/RovYKd3PJbi7NnFZGNv IYAJqsDWq8AwpxgqzEAi4Uw+bDao1nRdKaORbb75vnrdO8QjP+SxISVg/UPMOHt9euAf 46hgTz74Cs5JA/eEkcR7Xb2EDam3/gC8efwflXeKpYIVSjLZ30DI+qF+X/iKw7OJERo/ pPt3uYy1YV7iyAUt3JZvNGdbB6d9sjyJYq4nZMjjSs6Vq7RIj2JN6YS687fNyYxUSsMg WbkvgwCTSMUNCdWaM3pMuCeS/C89SRl0pxrUcXSQryrBuFSeKfTuoZG4ayUvUytWKLJs +yDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@manjusaka.me header.s=fm3 header.b=lFQJQ6nV; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=f7g+IaoQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020a17090acc1300b0025e7ff46234si10876800pju.57.2023.08.08.09.38.37; Tue, 08 Aug 2023 09:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@manjusaka.me header.s=fm3 header.b=lFQJQ6nV; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=f7g+IaoQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232426AbjHHQQK (ORCPT + 99 others); Tue, 8 Aug 2023 12:16:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbjHHQOZ (ORCPT ); Tue, 8 Aug 2023 12:14:25 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E6E83C3A; Tue, 8 Aug 2023 08:41:02 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B749B5C0090; Tue, 8 Aug 2023 00:50:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 08 Aug 2023 00:50:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjusaka.me; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1691470254; x=1691556654; bh=Wm7vgVpyNkBovEIVcDALXg67wDGyu9eYENE 6yQjh/qo=; b=lFQJQ6nVziMDKcES6RNB32k3lPEozvdgM/igCLTgkXuwis+6A0j exxvtzVnnBL+dwILAC3txSK8K/fL5hBvHiyC9+Tr/xwaH/PYHx8cgXJ8AnRvVBp0 TSBS6QpkI9LCAG3gXBcsy21msfdLvP4/mvrlJ8BTIVIAgQsJwEW1WpHE0tIOEd6L ugoqUUP99A+NomxQw6jPYKEZon1/yAiKbbT8igdEKdP1eyPbQZYd3RJQ+q61juoa avXqO/zmcZIAzZOniWL33aoY+mBjy7B0mWv8YLW1N1qihqLr4PmHRIZsA9ySjwxZ esiz/Axtdhoq7DTIztcHikKwZ87SvWaS8hA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1691470254; x=1691556654; bh=Wm7vgVpyNkBovEIVcDALXg67wDGyu9eYENE 6yQjh/qo=; b=f7g+IaoQM35PVL4ZEAIZqC7dTkKJe4xNoVSrGFjX/mN+JWQDU/n OlA2aV9ipoq9wOA+a7W2siWpATxORIHGqvsVoBrWKnV/ZgMFjKfii59WeANNOgtX HVyHTgZt/qKHHJW7xFGWtPc1KBXVRWANyySyeYP8e1QltIXVgoXitevHDeZgwhxd S6Thnjb2NfagG2giJR15QANlvu8wEKYo7hqVMetv9hIjCmvStZhpZuzuTcmGEcAa nVqGCSU324EPhk1LRoGQUXqOiCpc8hT/I3Ni+PcZcneORDHZJCP9u8e8KHlA3ta2 bIU3Q1d+BOyjysaTWm4Q47NJRNZ7e69JpJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrledugdekhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomhepofgrnhhj uhhsrghkrgcuoehmvgesmhgrnhhjuhhsrghkrgdrmhgvqeenucggtffrrghtthgvrhhnpe duveevjefhjedvgeevvdeutdeukeeljeelhfeftdehkefhfeeivdfgudekueeileenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmvgesmhgrnh hjuhhsrghkrgdrmhgv X-ME-Proxy: Feedback-ID: i3ea9498d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Aug 2023 00:50:50 -0400 (EDT) Message-ID: <517d5988-2e71-4ba5-9588-15218eebc8ef@manjusaka.me> Date: Tue, 8 Aug 2023 12:50:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tracepoint: add new `tcp:tcp_ca_event_set` trace event Content-Language: en-US To: Neal Cardwell Cc: edumazet@google.com, mhiramat@kernel.org, rostedt@goodmis.org, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org References: <20230807183308.9015-1-me@manjusaka.me> From: Manjusaka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/8/8 04:00, Neal Cardwell wrote: > On Mon, Aug 7, 2023 at 2:33 PM Manjusaka wrote: >> >> In normal use case, the tcp_ca_event would be changed in high frequency. >> >> It's a good indicator to represent the network quanlity. >> >> So I propose to add a `tcp:tcp_ca_event_set` trace event >> like `tcp:tcp_cong_state_set` to help the people to >> trace the TCP connection status >> >> Signed-off-by: Manjusaka >> --- >> include/net/tcp.h | 9 ++------ >> include/trace/events/tcp.h | 45 ++++++++++++++++++++++++++++++++++++++ >> net/ipv4/tcp_cong.c | 10 +++++++++ >> 3 files changed, 57 insertions(+), 7 deletions(-) >> >> diff --git a/include/net/tcp.h b/include/net/tcp.h >> index 0ca972ebd3dd..a68c5b61889c 100644 >> --- a/include/net/tcp.h >> +++ b/include/net/tcp.h >> @@ -1154,13 +1154,8 @@ static inline bool tcp_ca_needs_ecn(const struct sock *sk) >> return icsk->icsk_ca_ops->flags & TCP_CONG_NEEDS_ECN; >> } >> >> -static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event) >> -{ >> - const struct inet_connection_sock *icsk = inet_csk(sk); >> - >> - if (icsk->icsk_ca_ops->cwnd_event) >> - icsk->icsk_ca_ops->cwnd_event(sk, event); >> -} >> +/* from tcp_cong.c */ >> +void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event); >> >> /* From tcp_cong.c */ >> void tcp_set_ca_state(struct sock *sk, const u8 ca_state); >> diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h >> index bf06db8d2046..38415c5f1d52 100644 >> --- a/include/trace/events/tcp.h >> +++ b/include/trace/events/tcp.h >> @@ -416,6 +416,51 @@ TRACE_EVENT(tcp_cong_state_set, >> __entry->cong_state) >> ); >> >> +TRACE_EVENT(tcp_ca_event_set, > > Regarding the proposed name, "tcp_ca_event_set"... including "set" in > the name is confusing, since the tcp_ca_event() function is not really > setting anything. :-) > > The trace_tcp_cong_state_set() call you are using as a model has "set" > in the name because the function it is tracing, tcp_set_ca_state(), > has "set" in the name. :-) > > Would it work to use something like: > TRACE_EVENT(tcp_ca_event, > > thanks, > neal Emmmm, sorry about the confusing var name and thanks for the review. I will update my patch ASAP. best regards Manjusaka