summaryrefslogtreecommitdiffstats
path: root/fs/afs/rxrpc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-11-02 15:27:51 +0000
committerDavid Howells <dhowells@redhat.com>2017-11-13 15:38:19 +0000
commit025db80c9e421efef11f2b83b7f78a11476f06db (patch)
tree1c6e049f2ae3a380f4242d0eda61d759412cdc41 /fs/afs/rxrpc.c
parentbecfcc7e576eed03b93f412769573c93de550527 (diff)
downloadop-kernel-dev-025db80c9e421efef11f2b83b7f78a11476f06db.zip
op-kernel-dev-025db80c9e421efef11f2b83b7f78a11476f06db.tar.gz
afs: Trace the initiation and completion of client calls
Add tracepoints to trace the initiation and completion of client calls within the kafs filesystem. The afs_make_vl_call tracepoint watches calls to the volume location database server. The afs_make_fs_call tracepoint watches calls to the file server. The afs_call_done tracepoint watches for call completion. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/rxrpc.c')
-rw-r--r--fs/afs/rxrpc.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 1d07569..59cc580 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -219,6 +219,7 @@ struct afs_call *afs_alloc_flat_call(struct afs_net *net,
goto nomem_free;
}
+ call->operation_ID = type->op;
init_waitqueue_head(&call->waitq);
return call;
@@ -422,6 +423,8 @@ error_do_abort:
ac->abort_code = call->abort_code;
ac->responded = true;
}
+ call->error = ret;
+ trace_afs_call_done(call);
error_kill_call:
afs_put_call(call);
ac->error = ret;
@@ -455,10 +458,10 @@ static void afs_deliver_to_call(struct afs_call *call)
if (ret == -EINPROGRESS || ret == -EAGAIN)
return;
- if (ret == 1 || ret < 0) {
- call->state = AFS_CALL_COMPLETE;
- goto done;
- }
+ if (ret < 0)
+ call->error = ret;
+ if (ret < 0 || ret == 1)
+ goto call_complete;
return;
}
@@ -466,7 +469,7 @@ static void afs_deliver_to_call(struct afs_call *call)
switch (ret) {
case 0:
if (call->state == AFS_CALL_AWAIT_REPLY)
- call->state = AFS_CALL_COMPLETE;
+ goto call_complete;
goto done;
case -EINPROGRESS:
case -EAGAIN:
@@ -505,7 +508,11 @@ out:
save_error:
call->error = ret;
- call->state = AFS_CALL_COMPLETE;
+call_complete:
+ if (call->state != AFS_CALL_COMPLETE) {
+ call->state = AFS_CALL_COMPLETE;
+ trace_afs_call_done(call);
+ }
goto done;
}
@@ -567,8 +574,10 @@ static long afs_wait_for_call_to_complete(struct afs_call *call,
if (call->state < AFS_CALL_COMPLETE) {
_debug("call interrupted");
if (rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
- RX_USER_ABORT, -EINTR, "KWI"))
+ RX_USER_ABORT, -EINTR, "KWI")) {
call->error = -ERESTARTSYS;
+ trace_afs_call_done(call);
+ }
}
ac->abort_code = call->abort_code;
@@ -882,6 +891,7 @@ int afs_extract_data(struct afs_call *call, void *buf, size_t count,
switch (call->state) {
case AFS_CALL_AWAIT_REPLY:
call->state = AFS_CALL_COMPLETE;
+ trace_afs_call_done(call);
break;
case AFS_CALL_AWAIT_REQUEST:
call->state = AFS_CALL_REPLYING;
@@ -894,5 +904,6 @@ int afs_extract_data(struct afs_call *call, void *buf, size_t count,
call->error = ret;
call->state = AFS_CALL_COMPLETE;
+ trace_afs_call_done(call);
return ret;
}
OpenPOWER on IntegriCloud