core: add tracepoints for queueing skb to rcvbuf
[firefly-linux-kernel-4.4.55.git] / net / core / sock.c
index 6e819780c23252b3387c1b2daec25a261fa1f2fb..76c40314675038f35669ca3642fcf73fbce89d67 100644 (file)
 
 #include <linux/filter.h>
 
+#include <trace/events/sock.h>
+
 #ifdef CONFIG_INET
 #include <net/tcp.h>
 #endif
@@ -292,6 +294,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
        if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
            (unsigned)sk->sk_rcvbuf) {
                atomic_inc(&sk->sk_drops);
+               trace_sock_rcvqueue_full(sk, skb);
                return -ENOMEM;
        }
 
@@ -1736,6 +1739,8 @@ suppress_allocation:
                        return 1;
        }
 
+       trace_sock_exceed_buf_limit(sk, prot, allocated);
+
        /* Alas. Undo changes. */
        sk->sk_forward_alloc -= amt * SK_MEM_QUANTUM;
        atomic_long_sub(amt, prot->memory_allocated);