Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp327581lqb; Thu, 29 Feb 2024 02:02:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcIhi3ve76kgcyQpyiypo8AulI9MYiS3c00ROrs/q9tuDD4ItdJe1iGw46Hqg3NW1zbzEsW1wwyoyOSWBXc0K9WUbLr24/PcknyQ1FcQ== X-Google-Smtp-Source: AGHT+IGUGWmQMnvabxkBgi+NdN7edlB4l4Xfkk9lJeD/tf/Z/w5nYXZbtjzPouqIQkRxqzEOoxFT X-Received: by 2002:a05:620a:16d9:b0:787:bb6b:f024 with SMTP id a25-20020a05620a16d900b00787bb6bf024mr1816998qkn.60.1709200976660; Thu, 29 Feb 2024 02:02:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709200976; cv=pass; d=google.com; s=arc-20160816; b=uTmz7b6a3bMngjYEkC8nZ/QZeEouQ0m5Qtbk1kEqXP9FtkgyqmHsfgWjWkn8RUF+mG dOgxyqJFHDp5tsbOF1TlkIT13mVgVWHkbyR+BSr5Cm2eXmajKI6UxCKPzbG7E7sp5QaC JiTFAkqUn1Ca5H1w1EZbKMJ/fRtxJd0lKrka4m8yXLM2G3+P9bDE4db8x1DLK98iI5Ai QgBpz9+JDS+mfxjbOb7wPYvks0Hkz+d28QcaM9CninuKwuR+5572wd5svf6O3vFEnI6B 2IBu53vhaHma1hVCsdAukx7Ru0ucYky3fIng8mvCiVkPcuV/uly/uclrUtKganCIFhWe cROg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=z5jta4vjvJ7/12MtOocaS6dVP2qRC6nZvFeLA6WW4lo=; fh=rZFthxYWmuT3aS/SEmIk5cC34LZu/dK2uQgvjiB+oOk=; b=t4AwP1/j2N1aMzxDJL365F2J9RpJuYukvaJjqZaBf/b1acl4scgT1Lq4NdJ6fxwIWL oz4EeAVJ15qNHmpjA+fOr7Djy4u9bio20ws5WCACEWXdBbA+VieiftKJeTI4XYqYy7TW 4DjjSrrCjP2H2qpvdxkKvyKj5oaG3BdH2sjmEvhL2Wbo+bcPpt762Hmtd5jTwuO78nTn m2QDz38PitaAM6mz3FNXwLOd4aaiZPlCyWeV3GYiK2m68IYfuvRKrFTWKcNUOtSb/qWR 49sXOWHrC838ryBDX6m+xL/gTnsMFqcSeGU5JbhEVNHtftgEMcaK8pdwjg54n5BIJI/B 9emg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cHTpnWtR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-86496-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86496-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vu5-20020a05620a560500b00787e1ec459fsi971865qkn.710.2024.02.29.02.02.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:02:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86496-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cHTpnWtR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-86496-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86496-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 66B461C22271 for ; Thu, 29 Feb 2024 10:02:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BF7A63503; Thu, 29 Feb 2024 10:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cHTpnWtR" Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C507634F4; Thu, 29 Feb 2024 10:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709200970; cv=none; b=beHzVVnimhnmgUz0FcYk3s3hLD9AYdvzU1Zz9Dn9XVhjTG8nPoTSABqYbOEFs5c6eRkjtB67/J+vPbdsOERsRWhbZnQIVN8TV1TEgaGm2GjlRx+2pMAJjN+8BO+0q0R27SZhiSz4rTNXvmdKnfohILXQBDS7VEJVf27e1k1PVK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709200970; c=relaxed/simple; bh=JFtlQtX08v24Ylx3dxXE35IPy+/hi1g6yJZ61zeJeQ4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Content-Type; b=ez4yPgOJyrovEAP+yhwad6vPSS3vGmlaNqz8SdTlIpXCgbg1HQI15whzhA3F0gwoNkCNMRzs8pU9D/Nb4jiNVApNGGX6XkYymKhGF9qjFjLCSZTkwK+Axhi21t9bn+8q0f9MA5iBKuU+HwFbXI5lVlmxwCWWVOBtOorbWLFzaEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cHTpnWtR; arc=none smtp.client-ip=209.85.219.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f194.google.com with SMTP id 3f1490d57ef6-dcbef31a9dbso559214276.1; Thu, 29 Feb 2024 02:02:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709200968; x=1709805768; darn=vger.kernel.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z5jta4vjvJ7/12MtOocaS6dVP2qRC6nZvFeLA6WW4lo=; b=cHTpnWtRMCsFXVQEoH9nGFY5DFctFL9rkjidH9qqHKh9TvFD4FnUmh1JVr+FLaDLCj +NL+XlR91hQIjc79OnleT3V7hw7CTlhacY6RvYoRrg+4kPCMuQcQVOlTtqIF/M/Yj5/L 2Sddq9ERMRCiRoiyRDlw8MHsNfP2eHu2CmH8ve5w7ls1YNhorIFmYjww+kZr9boXkH4H +oXsL+9t3L1PXtkqfpi60RZVGGiicwXK6HznQjI/VWNHRFLj12Bgq5bsSUfQI5Z18Dz4 xwb8mL0X6tQS5+2SFpc3ZGEnYRTzyL3iIaADjIqp3Ea8edtovsfmFGebMpE29Z5E810O /z4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709200968; x=1709805768; h=content-transfer-encoding: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=z5jta4vjvJ7/12MtOocaS6dVP2qRC6nZvFeLA6WW4lo=; b=IJtntGEcgCSAfzOpGu3lBARO6Qalm6/6NpV+G9BRHA+xfbMe+p9RxkIBcMm5iAxv5F KBTTxtH7veiW7baFcuqPESXR0Aq2YgpPeTiQcjy394pF0PObHLhBl17HOuwt+YDmKRCT CZ2PbdJsUevN0v3DDrwoe9c5QpRagtorhn1CvXbITgUQsjKHMca2R/xF+Pt9795jpZbm dpl6+OlKegwPCdEFlAJnfwlU4fqgRAtAfc59ZHxarFbtkslMsxfk6h2kK3zpUFlsj9Nt k/XjarXmNqMIDdwd/2Udqfa5/6hf9GpVPNk4D/nDlUHtRQpWu/EhVfvBIVtpPH8RpgeL jsTw== X-Forwarded-Encrypted: i=1; AJvYcCVIVEKzdjnABZjzeJdjOZ0rBUegX9V/g1RJnifFLymwWhGzs6rfXObe2KiXF2gZwnuEPC2qPAsqLRfKUJCGOZhGt+gH18F3B9hJJT8SpvyUwIoZ X-Gm-Message-State: AOJu0Yz/4/P4gyOo88g0e9DUU7n/mi2hzP4h1BYlTMShzHtshnKIQJCs PZYO0NLBSQ1RdtyxpvmG/LIY+DMtSn0jkUm17yJkLFKch8eOSgRHMNthS2CawbKbRuzKc+mr1N7 F2EYMhMyoBMeQTkN2Wo0YdJDgl6s05aGkTf4LGbo= X-Received: by 2002:a25:7506:0:b0:dcc:f5d4:8b43 with SMTP id q6-20020a257506000000b00dccf5d48b43mr1790680ybc.9.1709200967984; Thu, 29 Feb 2024 02:02:47 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240229052813.GA23899@didi-ThinkCentre-M920t-N000> In-Reply-To: From: yuanli fu Date: Thu, 29 Feb 2024 18:02:35 +0800 Message-ID: Subject: Fwd: [PATCH] tcp: Add skb addr and sock addr to arguments of tracepoint tcp_probe. To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ---------- Forwarded message --------- =E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A yuanli fu Date: 2024=E5=B9=B42=E6=9C=8829=E6=97=A5=E5=91=A8=E5=9B=9B 16:27 Subject: Re: [PATCH] tcp: Add skb addr and sock addr to arguments of tracepoint tcp_probe. To: Jason Xing Jason Xing =E4=BA=8E2024=E5=B9=B42=E6=9C=8829= =E6=97=A5=E5=91=A8=E5=9B=9B 15:30=E5=86=99=E9=81=93=EF=BC=9A > > On Thu, Feb 29, 2024 at 1:33=E2=80=AFPM fuyuanli wrote: > > > > It is useful to expose skb addr and sock addr to user in tracepoint > > tcp_probe, so that we can get more information while monitoring > > receiving of tcp data, by ebpf or other ways. > > > > For example, we need to identify a packet by seq and end_seq when > > calculate transmit latency between lay 2 and lay 4 by ebpf, but which i= s > > not available in tcp_probe, so we can only use kprobe hooking > > tcp_rcv_esatblised to get them. But we can use tcp_probe directly if sk= b > > addr and sock addr are available, which is more efficient. > > > > Signed-off-by: fuyuanli > > Please target 'net-next' in the title of your v2 patch. Got it, thanks. > > > --- > > include/trace/events/tcp.h | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h > > index 7b1ddffa3dfc..096c15f64b92 100644 > > --- a/include/trace/events/tcp.h > > +++ b/include/trace/events/tcp.h > > @@ -258,6 +258,8 @@ TRACE_EVENT(tcp_probe, > > __field(__u32, srtt) > > __field(__u32, rcv_wnd) > > __field(__u64, sock_cookie) > > + __field(const void *, skbaddr) > > + __field(const void *, skaddr) > > ), > > > > TP_fast_assign( > > @@ -285,6 +287,9 @@ TRACE_EVENT(tcp_probe, > > __entry->ssthresh =3D tcp_current_ssthresh(sk); > > __entry->srtt =3D tp->srtt_us >> 3; > > __entry->sock_cookie =3D sock_gen_cookie(sk); > > + > > + __entry->skbaddr =3D skb; > > + __entry->skaddr =3D sk; > > ), > > > > TP_printk("family=3D%s src=3D%pISpc dest=3D%pISpc mark=3D%#x da= ta_len=3D%d snd_nxt=3D%#x snd_una=3D%#x snd_cwnd=3D%u ssthresh=3D%u snd_wnd= =3D%u srtt=3D%u rcv_wnd=3D%u sock_cookie=3D%llx", > > If they are useful, at least you should printk those two addresses > like what trace_kfree_skb() does. > Got it, I will add to printk > May I ask how it could be useful if there is no more function printing > such information in the receive path? We can get seq and end_seq by skbaddr in netif_receive_skb, so latency between l2->l4 can be calculated. > > Thanks, > Jason > > -- > > 2.17.1 > > > > > thanks fuyuanli