Skip to content

Commit

Permalink
tcp: add missing family to tcp_set_ca_state() tracepoint
Browse files Browse the repository at this point in the history
Before this code is copied, add the missing family, as we did in
commit 3dd344e ("net: tracepoint: exposing sk_family in all tcp:tracepoints")

Fixes: 15fcdf6 ("tcp: Add tracepoint for tcp_set_ca_state")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ping Gan <jacky_gam_2001@163.com>
Cc: Manjusaka <me@manjusaka.me>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230808084923.2239142-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and kuba-moo committed Aug 9, 2023
1 parent f8d3e0d commit 8a70ed9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/trace/events/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ TRACE_EVENT(tcp_cong_state_set,
__field(const void *, skaddr)
__field(__u16, sport)
__field(__u16, dport)
__field(__u16, family)
__array(__u8, saddr, 4)
__array(__u8, daddr, 4)
__array(__u8, saddr_v6, 16)
Expand All @@ -396,6 +397,7 @@ TRACE_EVENT(tcp_cong_state_set,

__entry->sport = ntohs(inet->inet_sport);
__entry->dport = ntohs(inet->inet_dport);
__entry->family = sk->sk_family;

p32 = (__be32 *) __entry->saddr;
*p32 = inet->inet_saddr;
Expand All @@ -409,7 +411,8 @@ TRACE_EVENT(tcp_cong_state_set,
__entry->cong_state = ca_state;
),

TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c cong_state=%u",
TP_printk("family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c cong_state=%u",
show_family_name(__entry->family),
__entry->sport, __entry->dport,
__entry->saddr, __entry->daddr,
__entry->saddr_v6, __entry->daddr_v6,
Expand Down

0 comments on commit 8a70ed9

Please sign in to comment.