diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index bf20ca7252b0..794b556cfd7f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -91,6 +91,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_prepare_prio_fork); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_finish_prio_fork); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_user_nice); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_setscheduler); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_nf_conn_alloc); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_nf_conn_free); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_arch_set_freq_scale); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init); diff --git a/include/trace/hooks/net.h b/include/trace/hooks/net.h index 31e0f21373e8..b2f68a1d8987 100644 --- a/include/trace/hooks/net.h +++ b/include/trace/hooks/net.h @@ -18,6 +18,12 @@ DECLARE_HOOK(android_vh_ptype_head, DECLARE_HOOK(android_vh_kfree_skb, TP_PROTO(struct sk_buff *skb), TP_ARGS(skb)); +struct nf_conn; +DECLARE_RESTRICTED_HOOK(android_rvh_nf_conn_alloc, + TP_PROTO(struct nf_conn *nf_conn), TP_ARGS(nf_conn), 1); +DECLARE_RESTRICTED_HOOK(android_rvh_nf_conn_free, + TP_PROTO(struct nf_conn *nf_conn), TP_ARGS(nf_conn), 1); + /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_NET_VH_H */ diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index ff0168736f6e..573e0b817d05 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -1514,6 +1515,8 @@ __nf_conntrack_alloc(struct net *net, nf_ct_zone_add(ct, zone); + trace_android_rvh_nf_conn_alloc(ct); + /* Because we use RCU lookups, we set ct_general.use to zero before * this is inserted in any list. */ @@ -1546,6 +1549,7 @@ void nf_conntrack_free(struct nf_conn *ct) nf_ct_ext_destroy(ct); kmem_cache_free(nf_conntrack_cachep, ct); smp_mb__before_atomic(); + trace_android_rvh_nf_conn_free(ct); atomic_dec(&net->ct.count); } EXPORT_SYMBOL_GPL(nf_conntrack_free);