Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7503186rwl; Tue, 10 Jan 2023 01:26:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXuZkFk0q0sDrPGc4SHMvZ5mZRZ6F8Sbnt1usnIbhB+tpnBWEOHwdPUgEJ+Rp0t4OU8n1tZF X-Received: by 2002:a17:907:d10:b0:82d:e258:fa55 with SMTP id gn16-20020a1709070d1000b0082de258fa55mr66880653ejc.36.1673342801471; Tue, 10 Jan 2023 01:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673342801; cv=none; d=google.com; s=arc-20160816; b=dl6LRupVKNjdFkFYF84OL8DaplZ14lZjZJoQ45GCmAD1l9OiRvWAvioUzNhLQdn1c3 Z3WbRFo+vYKxiLHR6DbmNrpSR8Xc4GEVNvxpXdd+AagO6iXO0ErU4TKjRfuAiQ5wRXzn u76PEhW1nhMAlx473RHA/PLHv4a4cnkgOxWXri0aajem6oV8QGosL8OLNS4yFHIUbuIr Y3IFZ5bjxK7lILH71Vj+vKP5hsimp8Dbyc0MfJOpr3sBSGGDpPxG2nwH/tTbp9waWmE+ La5uIU/Aq3IWCQz8CYMAAiXy61p+c6HT+5LdOZAIKkn6DVu4XyvbHAZGdoamtxPb4hA7 wtFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3+knuQydFBSdXCzPBUm1wNWUOfzUCjvanxuabDgK1gw=; b=xaC5uyY/D6yx4bQq4XKQQH2ywmDYQnMpEr7KXlerYPh9A1ff13T7976alfiiWLFPZQ 4avheuf1HMruw8EElseOqW9uGhcIupxNAMvpGJCzF070I9Sgqib1EiyK96aiOJ8U5Ce4 dSb0VDpVW/prBj4atNVuAZRuQ8QDX6GZjeYx6yjYd2DAuRTk4IKIL706gm71Qay996t1 9f2ZyPwt1ARLpfHWq7ZQfo8JuZdHBeKzavnVLa7TSzxFUQpzTRM7FqkihJSiIPfGmscl ArCCIU45r9VNvO/Y2G59mIb3N8yUt9uRPiLbruonEDyA1PJvyiyJQxED20XhN76KomMF 0fow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="Vwsl/Vit"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020a1709065d1300b007c10640d8e0si430305ejt.723.2023.01.10.01.26.28; Tue, 10 Jan 2023 01:26:41 -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; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="Vwsl/Vit"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238140AbjAJJBh (ORCPT + 55 others); Tue, 10 Jan 2023 04:01:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237536AbjAJJAR (ORCPT ); Tue, 10 Jan 2023 04:00:17 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50352574EF for ; Tue, 10 Jan 2023 00:58:49 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so9259429wms.2 for ; Tue, 10 Jan 2023 00:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3+knuQydFBSdXCzPBUm1wNWUOfzUCjvanxuabDgK1gw=; b=Vwsl/VitKXsjcFz1KYmcE983i6kgsxLO3q7CQ7b7PdZx3ibrn+X9o5JUrRrnrBHugy pzycvCwJ02EP/7RDyNObaKSV+y+uuYoK7cW8saBFKs1pds86xYXZ9QQQTifdYFX9VWp2 1THyM/CrZw/izNVOqgh01Bnf04RZiZcd3ppMjfDC1B7/ppRKAJ6w13vX2qXMxZoNk75M NfSzaseLCJ+j5CZfN5geOd5+sq7qQySvQoGIEJN9efn2Rlm2Y3BePe7xpmbiX1M1D127 KsZ2Zsk/xUp6QREU+YWGqJngQOaP9sW55fSGCDYZOfOfYN13Vw3svExxYl3TI9g+BSil 5rbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3+knuQydFBSdXCzPBUm1wNWUOfzUCjvanxuabDgK1gw=; b=ZIqQGdR3JPGIuFytQGGpyz5sprnBa4T5GTKDSkY2mUxFXBqR45eKriIA1JYZXVnxDC OVYbOQkIFctm0LomtfN1x88m6rSyn56raCVXpgshTnGuqnUdHKbaC72LE/YFreM3a2Qc lJNtIJGx/YK3K0eP+oaNmsjpF88SVczOVCmGDVYlSja04F19bLR1ZZExy1BeUilZQ7wl RdQj8MQ8eD5HeFvtiHezBkkgKs+LUjyNp4bXPSp2fT5x7XC85GcOzlDzNx/9dLeFMKKL fR+OGWMHD4lyBBe6o4GM7qnOJqPGfwIl5yUeF720F9r9B6CeGtBrlS4e4mw8pEvFyO9b mvxg== X-Gm-Message-State: AFqh2koa4a3Iys7K63m9JpB2abS8r7fBnqcBAF2tXYquRhnGjTStvJHn SR7Bw+slkcHeZwFGaReSCaBwhBQluUuuVy8/elOwtQ== X-Received: by 2002:a05:600c:47cf:b0:3cf:ecdb:bcb7 with SMTP id l15-20020a05600c47cf00b003cfecdbbcb7mr2935722wmo.180.1673341127770; Tue, 10 Jan 2023 00:58:47 -0800 (PST) MIME-Version: 1.0 References: <20230108025545.338-1-cuiyunhui@bytedance.com> <20230109100833.03f4d4b1@gandalf.local.home> <20230109103922.656eb286@gandalf.local.home> In-Reply-To: <20230109103922.656eb286@gandalf.local.home> From: =?UTF-8?B?6L+Q6L6J5bSU?= Date: Tue, 10 Jan 2023 16:58:36 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v4] sock: add tracepoint for send recv length To: Steven Rostedt 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Mon, Jan 9, 2023 at 11:39 PM Steven Rostedt wrote: > > But looking at this tracepoint again, I see a issue that can help with the > dereferencing. > > Why is family and protocol passed in? > > + trace_sock_send_length(sock->sk, sock->sk->sk_family, > + sock->sk->sk_protocol, ret, 0); > > > Where the TP_fast_assign() is: > > + TP_fast_assign( > + __entry->sk = sk; > + __entry->family = sk->sk_family; > + __entry->protocol = sk->sk_protocol; > + __entry->length = ret > 0 ? ret : 0; > + __entry->error = ret < 0 ? ret : 0; > + __entry->flags = flags; > + ), > > The family and protocol is taken from the sk, and not the parameters. I bet > dropping those would help. > > -- Steve > Many thanks to Eric and Steven for your discussions and suggestions, I will update on v5. Thanks, Yunhui