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: Dezhi Huang <huangdezhi@hihonor.com>
This commit is contained in:
h00013079 2024-06-07 15:40:06 +08:00 committed by Treehugger Robot
parent df9e426fab
commit 9842b4145b
3 changed files with 6 additions and 0 deletions

View File

@ -340,6 +340,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf_pr_cont);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_slowpath);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmap_region);
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_try_to_unmap_one);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_reader_owned);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_rwsem_reader_owned);

View File

@ -62,6 +62,8 @@ DECLARE_HOOK(android_vh_build_skb_around,
TP_PROTO(struct sk_buff *skb), TP_ARGS(skb));
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));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_NET_VH_H */

View File

@ -3993,6 +3993,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);