Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2527061imm; Mon, 24 Sep 2018 05:58:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV61xrsJotzZi/9Ukpiel/0uqDXsLbInBsduNUAuYP9cqgb2m24Cqy+pas6clwwuQ5mXjLIcw X-Received: by 2002:a17:902:2804:: with SMTP id e4-v6mr10495518plb.327.1537793922044; Mon, 24 Sep 2018 05:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793922; cv=none; d=google.com; s=arc-20160816; b=NsegR7raPU34THe00WyVtjR8SKKhY9GDOT6UVXzjHhzA1t8HsFEtUrN5bKZXsNZSFz EW3jE2d9dTbPzh6my6/ztJSxgMZrIdyml+avA2STvXlNk052z+/fZnn2Al3MpFHlIny+ JUCbKiaEgA1i0O3Z9j1as1t+OEagmZZ6T6TTC4PB1OUoMxA5MqANkTq70/gjxYBPet+C wQA2w8PVHubGoqJud+Pi4wzFwXNSRMzzGlXLXayWrXdO6/xyWcNhGdYk9T8sGS2P4FYU ANuEb0R1lWer5gotRoQ2ItHDpw2CkzeVO00i4DDf+mGANyMO61i2f6GwbDhBsByiV1Ue Qu6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=4OR+7QjftOZzjGgAgxRBxdeRcGac0vGVIHllmaTmn24=; b=VeW+vy9eToDyt2FVRXnPdBK4KtkSYIZjj3zgUzSs5yNZHa6hgKtYzi7/+F2n/qP8p9 280jDqZXY0ADui4kSS1uaWJvYI6Yh0rPAAolyCjwE5Wh2vTFEiaJ7vx2mAKPq9KtphhO IciLYYbsjCdWPwZkS9iHi44QaBlFuB6xXbK8Cw4P0TqOOSOZ1Fbh2iPnlHYOszPaWhuv jNc3nCywhHJIDC4Na+b7zwv9kMap4o62LnWlAEQg7AvI+s2ctItEn1NUhXekSTUVouhL z0m6XLWxCB8aMyIN5OLlbr8Dzk/nfPa6+IGO/WR8KQwc1+zn/ToIIWjktA7ro0wX3wdN LiSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MJvlIyFF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si8318979pgb.457.2018.09.24.05.58.26; Mon, 24 Sep 2018 05:58:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MJvlIyFF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731805AbeIXS77 (ORCPT + 99 others); Mon, 24 Sep 2018 14:59:59 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37240 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728650AbeIXS76 (ORCPT ); Mon, 24 Sep 2018 14:59:58 -0400 Received: by mail-pg1-f193.google.com with SMTP id c10-v6so2125693pgq.4; Mon, 24 Sep 2018 05:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4OR+7QjftOZzjGgAgxRBxdeRcGac0vGVIHllmaTmn24=; b=MJvlIyFFP6qGwKh2PoHXhAO83FBBUusjFrfPZJ565c0wMvMf4R+HhjlcWM3oQjrYCP e5HlVla5Gb8315MDVDohgrUHwMxhEY8c03+6LyyoSKQr5iBPkSgX4q9zZs1P2uIbtki2 4HvytkSW00Wj7S2w21QsGIYV+qMzz78k3SbgoK5V4E8S7xv2YBJ0F/+Qafrpxsc2v+kM SxWam4h8VFs+my92bF5EPEzfp8m94+gzclCKXFTfG1yH/U/YCjnjofOd5t8wpSMpbZOE CtHirUGURUcTV0CgNLodkDVhdzNp+G9D63nos11rYzJMrjDCm5bDV3Ue8weNuouZ0X9s aguQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4OR+7QjftOZzjGgAgxRBxdeRcGac0vGVIHllmaTmn24=; b=aMtbb93YhtT92568Y3qalKHkh/cmxEv8Urb96N76AfFuacr7Vis5x0h+zeJ17fn9To +xJOJp7aaVzlXfB4mAMCK6wsrtrSr/0i/uYt17efcFLwURLowrC2lL4Cx62rS2eAMiQq CiH9mphT8nbTS7UGCJM0evbuPWYwyjCQQp6MtRv1v/HM8sgAlE1rGjlIgjGoiR7sWljW SHb3nuPpO267uKbna37mD13eWMop4rq9Nm+qeEoP9oCGU0fkddCp+nYBXJB1r7B8Olyf 0Nm/Hzu8XjGi6AB08QzOFSMMc8NzSt4plPgUOtdiBcYswLGh5hEffMfnYRLTf9FRybru UgmA== X-Gm-Message-State: ABuFfoicIV8gWbc42IAHHW6+AG0i9GFODPccGMOAWHJYzSi2lpAGl1/5 aB4xSnfG24lH0iTnHd1GYQI= X-Received: by 2002:a63:28c7:: with SMTP id o190-v6mr9459230pgo.84.1537793875118; Mon, 24 Sep 2018 05:57:55 -0700 (PDT) Received: from bogon.didichuxing.com ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id u25-v6sm48679555pfk.177.2018.09.24.05.57.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 05:57:54 -0700 (PDT) From: Yafang Shao To: edumazet@google.com, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH v2 net-next] tcp: expose sk_state in tcp_retransmit_skb tracepoint Date: Mon, 24 Sep 2018 20:57:29 +0800 Message-Id: <1537793849-32396-1-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After sk_state exposed, we can get in which state this retransmission occurs. That could give us more detail for dignostic. For example, if this retransmission occurs in SYN_SENT state, it may also indicates that the syn packet may be dropped on the remote peer due to syn backlog queue full and then we could check the remote peer. BTW,SYNACK retransmission is traced in tcp_retransmit_synack tracepoint. Signed-off-by: Yafang Shao --- include/trace/events/tcp.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index ac55b32..2bc9960 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -56,6 +56,7 @@ TP_STRUCT__entry( __field(const void *, skbaddr) __field(const void *, skaddr) + __field(int, state) __field(__u16, sport) __field(__u16, dport) __array(__u8, saddr, 4) @@ -70,6 +71,7 @@ __entry->skbaddr = skb; __entry->skaddr = sk; + __entry->state = sk->sk_state; __entry->sport = ntohs(inet->inet_sport); __entry->dport = ntohs(inet->inet_dport); @@ -84,9 +86,10 @@ sk->sk_v6_rcv_saddr, sk->sk_v6_daddr); ), - TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c", + TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c state=%s\n", __entry->sport, __entry->dport, __entry->saddr, __entry->daddr, - __entry->saddr_v6, __entry->daddr_v6) + __entry->saddr_v6, __entry->daddr_v6, + show_tcp_state_name(__entry->state)) ); DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb, -- 1.8.3.1