diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index b140bc5bcfd9..05d85a991b10 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -257,6 +257,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_udp_unicast_rcv_skb); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_udp6_unicast_rcv_skb); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rcv_established_fast_path); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rcv_established_slow_path); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rcv_rtt_update); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_should_memcg_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_capacity_show); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init); diff --git a/include/trace/hooks/net.h b/include/trace/hooks/net.h index 8b74d4541773..531c5faf24d4 100644 --- a/include/trace/hooks/net.h +++ b/include/trace/hooks/net.h @@ -26,6 +26,7 @@ DECLARE_HOOK(android_vh_ptype_head, struct sock; struct sockaddr_in6; +struct tcp_sock; DECLARE_HOOK(android_vh_tcp_v4_connect, TP_PROTO(struct sock *sk, struct sockaddr *uaddr), TP_ARGS(sk, uaddr)); DECLARE_HOOK(android_vh_tcp_v6_connect, @@ -86,6 +87,8 @@ DECLARE_HOOK(android_vh_dc_send_copy, TP_PROTO(struct sk_buff *skb, struct net_device *dev), TP_ARGS(skb, dev)); DECLARE_HOOK(android_vh_dc_receive, TP_PROTO(struct sk_buff *skb, int *flag), TP_ARGS(skb, flag)); +DECLARE_HOOK(android_vh_tcp_rcv_rtt_update, + TP_PROTO(struct tcp_sock *tp, u32 sample, int win_dep), TP_ARGS(tp, sample, win_dep)); /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_NET_VH_H */ diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 4b9acaa531f3..a3c09134e9b3 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -649,6 +649,8 @@ static void tcp_rcv_rtt_update(struct tcp_sock *tp, u32 sample, int win_dep) u32 new_sample = tp->rcv_rtt_est.rtt_us; long m = sample; + trace_android_vh_tcp_rcv_rtt_update(tp, sample, win_dep); + if (new_sample != 0) { /* If we sample in larger samples in the non-timestamp * case, we could grossly overestimate the RTT especially