From 4f9e1ba6de45aa8797a83f1fe5b82ec4bac16899 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Wed, 29 Sep 2021 15:26:10 +0800 Subject: mctp: Add tracepoints for tag/key handling The tag allocation, release and bind events are somewhat opaque outside the kernel; this change adds a few tracepoints to assist in instrumentation and debugging. Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller --- net/mctp/af_mctp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/mctp/af_mctp.c') diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c index 46e5ede385cb..28cb1633bed6 100644 --- a/net/mctp/af_mctp.c +++ b/net/mctp/af_mctp.c @@ -16,6 +16,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include + /* socket implementation */ static int mctp_release(struct socket *sock) @@ -239,6 +242,7 @@ static void mctp_sk_expire_keys(struct timer_list *timer) spin_lock(&key->lock); if (!time_after_eq(key->expiry, jiffies)) { + trace_mctp_key_release(key, MCTP_TRACE_KEY_TIMEOUT); key->valid = false; hlist_del_rcu(&key->hlist); hlist_del_rcu(&key->sklist); @@ -310,6 +314,8 @@ static void mctp_sk_unhash(struct sock *sk) hlist_del(&key->sklist); hlist_del(&key->hlist); + trace_mctp_key_release(key, MCTP_TRACE_KEY_CLOSED); + spin_lock(&key->lock); if (key->reasm_head) kfree_skb(key->reasm_head); -- cgit