Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8828767rwl; Tue, 10 Jan 2023 20:24:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxJydOdHjymcu2c/s6/LNrGsgYuNkcqYO4zBDEzsu8bAjjGtryK6s4iE9DQe64yqyrK6Z6 X-Received: by 2002:a17:906:3453:b0:84d:39ba:368b with SMTP id d19-20020a170906345300b0084d39ba368bmr11279099ejb.75.1673411062163; Tue, 10 Jan 2023 20:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673411062; cv=none; d=google.com; s=arc-20160816; b=D8nXtd1KYu2WC1y4PzVNNM23TkAqRR7agcpvYAbXiov5LNnPtQaWi+yTi9tcV/jBtE hA5fXBc3M3BxS0LzALV3spH9jV30B6sPA3aTDMbCcw/UYs7xIr6BSQ32W7Lu1qjN4SFZ Bco6VCCGodBCA1gJQunRcDC+hd9HetUe3yBnt/wA7nUmja+nBaZnzk6mMBdWosJ1yoSm rgRLfIZGp8We0EruYPil1Pe5aYssKytRySPktdwSbbH+aVnoY1/y5PcRZRWiokjsxC8K fC6XQVBbnWnKIyPIHxY5JgZccpejQo9fyg29b6mI43sJg/eohTkjZDZT4cPAD6wCihTC YnHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=dLIxZizinQK0+DDutY2tHMSCxVO50Xn2+vY1gKGBvtk=; b=J+9k6yaU2MsIvg/gsJshDwCSBs/L2lFwMYJPQxYP9ny7GlnDo4tjCNeNvIJe9P1LRF oPtz+tw3bu3eQNvMvtNkdmzVqC39hfbx9mJ64hIjDla5sGLxOqdQMdzs9uyXNZmTtnJK 0X5YCDrJtU6yqCNV+oB5zxd2K4uRkDwQsidQZM+M8qjs/Ru7atdBGziiyxanyKPqSzqd EIYLczZSX8RQxsWYy57pVYtgEs31o7Zj9Y4jj2pAPWKfj2WQWBxDz8ADAH3HlZQ8Cz7t J7po2DZJDfPB/qz2CSIaNGl5yLAEcr/NZYl++Mu/pFsuaNZmVmwQysLa6c9MBl7CCSS3 Tu1w== ARC-Authentication-Results: i=1; mx.google.com; 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 hx9-20020a170906846900b0078d3a35e181si10215068ejc.871.2023.01.10.20.24.09; Tue, 10 Jan 2023 20:24:22 -0800 (PST) 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; 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 S231869AbjAKEMO convert rfc822-to-8bit (ORCPT + 53 others); Tue, 10 Jan 2023 23:12:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231655AbjAKEMI (ORCPT ); Tue, 10 Jan 2023 23:12:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63BC712AE3; Tue, 10 Jan 2023 20:12:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11A40B81AAE; Wed, 11 Jan 2023 04:12:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F32B2C433D2; Wed, 11 Jan 2023 04:12:02 +0000 (UTC) Date: Tue, 10 Jan 2023 23:12:01 -0500 From: Steven Rostedt To: =?UTF-8?B?6L+Q6L6J5bSU?= Cc: Eric Dumazet , mhiramat@kernel.org, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, kuniyu@amazon.com, xiyou.wangcong@gmail.com, duanxiongchun@bytedance.com, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, dust.li@linux.alibaba.com Subject: Re: [External] Re: [PATCH v5] sock: add tracepoint for send recv length Message-ID: <20230110231201.5eddb889@gandalf.local.home> In-Reply-To: References: <20230110091356.1524-1-cuiyunhui@bytedance.com> <20230110104419.67294691@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 Wed, 11 Jan 2023 11:53:24 +0800 运辉崔 wrote: > Hi Steve, Based on your suggestion, can we use the following code > instead of using DEFINE_EVENT_PRINT ? I only suggested it because you didn't have that logic for the sock_send_length trace event. But if you don't care about that one, then sure, use it for both. -- Steve > > DECLARE_EVENT_CLASS(sock_msg_length, > > TP_PROTO(struct sock *sk, int ret, int flags), > > TP_ARGS(sk, ret, flags), > > TP_STRUCT__entry( > __field(void *, sk) > __field(__u16, family) > __field(__u16, protocol) > __field(int, ret) > __field(int, flags) > ), > > TP_fast_assign( > __entry->sk = sk; > __entry->family = sk->sk_family; > __entry->protocol = sk->sk_protocol; > __entry->ret = ret; > __entry->flags = flags; > ), > > TP_printk("sk address = %p, family = %s protocol = %s, length > = %d, error = %d, flags = 0x%x", > __entry->sk, show_family_name(__entry->family), > show_inet_protocol_name(__entry->protocol), > !(__entry->flags & MSG_PEEK) ? > (__entry->ret > 0 ? __entry->ret : 0) : 0, > __entry->ret < 0 ? __entry->ret : 0, > __entry->flags) > );