afs: Add a tracepoint to record callbacks from unlisted servers
authorDavid Howells <dhowells@redhat.com>
Fri, 11 May 2018 21:59:42 +0000 (22:59 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 14 May 2018 14:15:18 +0000 (15:15 +0100)
Add a tracepoint to record callbacks from servers for which we don't have a
record.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/cmservice.c
include/trace/events/afs.h

index bcd13397bd59c85a2f54ff2100c2d9a451c5b42f..9f13375f49b8d612a59ee5ef6649722e2648a5ce 100644 (file)
@@ -287,8 +287,10 @@ static int afs_deliver_cb_callback(struct afs_call *call)
         * vnodes to operate upon */
        rxrpc_kernel_get_peer(call->net->socket, call->rxcall, &srx);
        server = afs_find_server(call->net, &srx);
-       if (!server)
+       if (!server) {
+               trace_afs_cm_no_server(call, &srx);
                return -ENOTCONN;
+       }
        call->cm_server = server;
 
        return afs_queue_call_work(call);
@@ -329,8 +331,10 @@ static int afs_deliver_cb_init_call_back_state(struct afs_call *call)
        /* we'll need the file server record as that tells us which set of
         * vnodes to operate upon */
        server = afs_find_server(call->net, &srx);
-       if (!server)
+       if (!server) {
+               trace_afs_cm_no_server(call, &srx);
                return -ENOTCONN;
+       }
        call->cm_server = server;
 
        return afs_queue_call_work(call);
@@ -400,8 +404,10 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
        rcu_read_lock();
        server = afs_find_server_by_uuid(call->net, call->request);
        rcu_read_unlock();
-       if (!server)
+       if (!server) {
+               trace_afs_cm_no_server_u(call, call->request);
                return -ENOTCONN;
+       }
        call->cm_server = server;
 
        return afs_queue_call_work(call);
index f0820554caa9d0630410dc12fbd06bae76f4eeac..d0a341bc45404b06c08f434d26030dd8be3138db 100644 (file)
@@ -575,6 +575,48 @@ TRACE_EVENT(afs_protocol_error,
                      __entry->call, __entry->error, __entry->where)
            );
 
+TRACE_EVENT(afs_cm_no_server,
+           TP_PROTO(struct afs_call *call, struct sockaddr_rxrpc *srx),
+
+           TP_ARGS(call, srx),
+
+           TP_STRUCT__entry(
+                   __field(unsigned int,                       call    )
+                   __field(unsigned int,                       op_id   )
+                   __field_struct(struct sockaddr_rxrpc,       srx     )
+                            ),
+
+           TP_fast_assign(
+                   __entry->call = call->debug_id;
+                   __entry->op_id = call->operation_ID;
+                   memcpy(&__entry->srx, srx, sizeof(__entry->srx));
+                          ),
+
+           TP_printk("c=%08x op=%u %pISpc",
+                     __entry->call, __entry->op_id, &__entry->srx.transport)
+           );
+
+TRACE_EVENT(afs_cm_no_server_u,
+           TP_PROTO(struct afs_call *call, const uuid_t *uuid),
+
+           TP_ARGS(call, uuid),
+
+           TP_STRUCT__entry(
+                   __field(unsigned int,                       call    )
+                   __field(unsigned int,                       op_id   )
+                   __field_struct(uuid_t,                      uuid    )
+                            ),
+
+           TP_fast_assign(
+                   __entry->call = call->debug_id;
+                   __entry->op_id = call->operation_ID;
+                   memcpy(&__entry->uuid, uuid, sizeof(__entry->uuid));
+                          ),
+
+           TP_printk("c=%08x op=%u %pU",
+                     __entry->call, __entry->op_id, &__entry->uuid)
+           );
+
 #endif /* _TRACE_AFS_H */
 
 /* This part must be outside protection */