Commit af4325ec authored by Yafang Shao's avatar Yafang Shao Committed by David S. Miller

tcp: expose sk_state in tcp_retransmit_skb tracepoint

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: default avatarYafang Shao <laoar.shao@gmail.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a715156
...@@ -56,6 +56,7 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb, ...@@ -56,6 +56,7 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(const void *, skbaddr) __field(const void *, skbaddr)
__field(const void *, skaddr) __field(const void *, skaddr)
__field(int, state)
__field(__u16, sport) __field(__u16, sport)
__field(__u16, dport) __field(__u16, dport)
__array(__u8, saddr, 4) __array(__u8, saddr, 4)
...@@ -70,6 +71,7 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb, ...@@ -70,6 +71,7 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb,
__entry->skbaddr = skb; __entry->skbaddr = skb;
__entry->skaddr = sk; __entry->skaddr = sk;
__entry->state = sk->sk_state;
__entry->sport = ntohs(inet->inet_sport); __entry->sport = ntohs(inet->inet_sport);
__entry->dport = ntohs(inet->inet_dport); __entry->dport = ntohs(inet->inet_dport);
...@@ -84,9 +86,10 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb, ...@@ -84,9 +86,10 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb,
sk->sk_v6_rcv_saddr, sk->sk_v6_daddr); 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->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, DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment