rxrpc: Adjust the call ref tracepoint to show kernel API refs
authorDavid Howells <dhowells@redhat.com>
Tue, 13 Sep 2016 08:12:34 +0000 (09:12 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 13 Sep 2016 21:38:30 +0000 (22:38 +0100)
Adjust the call ref tracepoint to show references held on a call by the
kernel API separately as much as possible and add an additional trace to at
the allocation point from the preallocation buffer for an incoming call.

Note that this doesn't show the allocation of a client call for the kernel
separately at the moment.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/af_rxrpc.c
net/rxrpc/ar-internal.h
net/rxrpc/call_accept.c
net/rxrpc/call_object.c

index caa226dd436e9015cff166e3b5ffdaf3a47c4e7f..25d00ded24bc9cb17c9ae9585f26b757dc1aef76 100644 (file)
@@ -299,7 +299,7 @@ void rxrpc_kernel_end_call(struct socket *sock, struct rxrpc_call *call)
 {
        _enter("%d{%d}", call->debug_id, atomic_read(&call->usage));
        rxrpc_release_call(rxrpc_sk(sock->sk), call);
-       rxrpc_put_call(call, rxrpc_call_put);
+       rxrpc_put_call(call, rxrpc_call_put_kernel);
 }
 EXPORT_SYMBOL(rxrpc_kernel_end_call);
 
index b1cb79ec4e969287520fac801fc69b8eed69b8ef..47c74a581a0fc8a2c886ead48466aac293adfaba 100644 (file)
@@ -540,8 +540,10 @@ enum rxrpc_call_trace {
        rxrpc_call_seen,
        rxrpc_call_got,
        rxrpc_call_got_userid,
+       rxrpc_call_got_kernel,
        rxrpc_call_put,
        rxrpc_call_put_userid,
+       rxrpc_call_put_kernel,
        rxrpc_call_put_noqueue,
        rxrpc_call__nr_trace
 };
index 06e328f6b0f08d12b5a1933ad69bfde647d9aaa9..5fd9d2c89b7f0fb604fd5e96800e5b2df548fb94 100644 (file)
@@ -121,7 +121,7 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
 
                call->user_call_ID = user_call_ID;
                call->notify_rx = notify_rx;
-               rxrpc_get_call(call, rxrpc_call_got);
+               rxrpc_get_call(call, rxrpc_call_got_kernel);
                user_attach_call(call, user_call_ID);
                rxrpc_get_call(call, rxrpc_call_got_userid);
                rb_link_node(&call->sock_node, parent, pp);
@@ -300,6 +300,7 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,
        smp_store_release(&b->call_backlog_tail,
                          (call_tail + 1) & (RXRPC_BACKLOG_MAX - 1));
 
+       rxrpc_see_call(call);
        call->conn = conn;
        call->peer = rxrpc_get_peer(conn->params.peer);
        return call;
index 18ab13f82f6e197b8b692d0adaff1dc23b56ff05..3f9476508204aa3f1e3bcb037934f2183730afc2 100644 (file)
@@ -56,8 +56,10 @@ const char rxrpc_call_traces[rxrpc_call__nr_trace][4] = {
        [rxrpc_call_seen]               = "SEE",
        [rxrpc_call_got]                = "GOT",
        [rxrpc_call_got_userid]         = "Gus",
+       [rxrpc_call_got_kernel]         = "Gke",
        [rxrpc_call_put]                = "PUT",
        [rxrpc_call_put_userid]         = "Pus",
+       [rxrpc_call_put_kernel]         = "Pke",
        [rxrpc_call_put_noqueue]        = "PNQ",
 };