ANDROID: GKI: net: add vendor hook for network quality estimation

Add vendor hook to support network quality estimation.
1.android_vh_tcp_connect
To save the device name when TCP connect request is sent.

Bug: 345643775
Change-Id: I9e2472565ee1b5653e2bc6c541e0d61e0c89d3ab
Signed-off-by: h00013079 <huangdezhi@hihonor.com>
(cherry picked from commit 9842b4145bac27ded1b112b3f90cb865d1598182)
This commit is contained in:
h00013079
2024-06-07 15:40:06 +08:00
committed by Treehugger Robot
parent 5d4636c02b
commit 65702a481a
3 changed files with 7 additions and 0 deletions
+1
View File
@@ -182,6 +182,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_panic_unhandled);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_arm64_serror_panic);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sea);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_write_timeout_estab_retrans);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_connect);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inet_csk_clone_lock);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_capacity_show);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init);
+2
View File
@@ -17,6 +17,8 @@ DECLARE_HOOK(android_vh_ptype_head,
struct sock;
DECLARE_HOOK(android_vh_tcp_write_timeout_estab_retrans,
TP_PROTO(struct sock *sk), TP_ARGS(sk));
DECLARE_HOOK(android_vh_tcp_connect,
TP_PROTO(struct sk_buff *skb), TP_ARGS(skb));
struct request_sock;
DECLARE_HOOK(android_vh_inet_csk_clone_lock,
TP_PROTO(struct sock *newsk, const struct request_sock *req), TP_ARGS(newsk, req));
+4
View File
@@ -48,6 +48,7 @@
#include <linux/skbuff_ref.h>
#include <trace/events/tcp.h>
#include <trace/hooks/net.h>
/* Refresh clocks of a TCP socket,
* ensuring monotically increasing values.
@@ -4152,6 +4153,9 @@ int tcp_connect(struct sock *sk)
*/
WRITE_ONCE(tp->snd_nxt, tp->write_seq);
tp->pushed_seq = tp->write_seq;
trace_android_vh_tcp_connect(buff);
buff = tcp_send_head(sk);
if (unlikely(buff)) {
WRITE_ONCE(tp->snd_nxt, TCP_SKB_CB(buff)->seq);