diff options
| author | Steve Dickson <steved@redhat.com> | 2011-05-29 14:51:37 -0400 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2011-05-29 14:51:37 -0400 |
| commit | 5d282eec7e97305b6735e84643fdb660fc92de93 (patch) | |
| tree | b98b053f46948d61bbc1b15cdb020e8d2f6d3038 | |
| parent | efb5e22eb4732a20b1b9fe909be89348aa59ae19 (diff) | |
| download | systemtap-5d282eec7e97305b6735e84643fdb660fc92de93.tar.gz systemtap-5d282eec7e97305b6735e84643fdb660fc92de93.tar.xz systemtap-5d282eec7e97305b6735e84643fdb660fc92de93.zip | |
Worked on some the the xprt routines.
Signed-off-by: Steve Dickson <steved@redhat.com>
| -rw-r--r-- | sunrpc/call_status.stp | 2 | ||||
| -rw-r--r-- | sunrpc/xprt.stp | 53 | ||||
| -rw-r--r-- | tapset/task.stp | 25 |
3 files changed, 71 insertions, 9 deletions
diff --git a/sunrpc/call_status.stp b/sunrpc/call_status.stp index 56976cd..9b7bb55 100644 --- a/sunrpc/call_status.stp +++ b/sunrpc/call_status.stp @@ -22,11 +22,13 @@ probe module("sunrpc").function("call_connect_status") printf("call_connect_status:%s:%s: error %d (%s)\n", cl_server($task), cl_prog($task), terror, errno_str(terror)); } +/* probe module("sunrpc").function("xs_tcp_finish_connecting").return { if ($return) printf("xs_tcp_finish_connecting: error %d (%s)\n", $return, errno_str($return)); } +*/ probe begin { log("starting call_status probe") } probe end { log("ending call_status probe") } diff --git a/sunrpc/xprt.stp b/sunrpc/xprt.stp index 34f8fe4..7f2fd48 100644 --- a/sunrpc/xprt.stp +++ b/sunrpc/xprt.stp @@ -1,8 +1,8 @@ -global xs_task, trans_task, udp_send_task +global xs_task, trans_task, udp_send_task, sendpages_sock probe module("sunrpc").function("xs_connect") { - printf("xs_connect: task %p\n", $task); + //printf("xs_connect: task %p\n", $task); xs_task = $task; //print_backtrace(); } @@ -14,23 +14,63 @@ probe module("sunrpc").function("xs_tcp_connect") xs_task = $task; } */ +/* probe module("sunrpc").function("xprt_connect_status") { - printf("xprt_connect_status: task %p\n", $task); + printf("xprt_connect_status: %s(%d), task %p\n", execname(), pid(), $task); } +*/ probe module("sunrpc").function("xprt_connect_status").return { - printf("xprt_connect_status: %s", task_dump(xs_task)); + printf("xprt_connect_status: %s(%d): %s\n", execname(), pid(), task_dump(xs_task)); } probe module("sunrpc").function("xprt_transmit") { - printf("xprt_transmit: task %p\n", $task); trans_task = $task; } probe module("sunrpc").function("xprt_transmit").return { - printf("xprt_transmit: %s", task_dump(trans_task)); + if (task_status(trans_task) && task_status(trans_task) != -11) + printf("xprt_transmit: %s(%d): %s\n\t%s\n", execname(), pid(), + task_dump(trans_task), xprt_dump(trans_task)); +} +probe module("sunrpc").function("xs_tcp_send_request").return +{ + if ($return < 0 && $return != -11) + printf("xs_tcp_send_request: %s(%d): status %d (%s)\n", execname(), pid(), + $return, errno_str($return)); +} +probe module("sunrpc").function("xs_sendpages") +{ + sendpages_sock = $sock +} +probe module("sunrpc").function("xs_sendpages").return +{ + if ($return < 0 && $return != -11) + printf("xs_sendpages: %s(%d): sock %p status %d (%s)\n", execname(), pid(), + sendpages_sock, $return, errno_str($return)); +} +probe module("sunrpc").function("xs_send_kvec").return +{ + if ($return < 0 && $return != -11) + printf("xs_send_kvec: %s(%d): status %d (%s)\n", execname(), pid(), + $return, errno_str($return)); } +/* +probe module("sunrpc").function("xs_send_pagedata").return +{ + if ($return < 0) + printf("xs_send_pagedata: %s(%d): status %d (%s)\n", execname(), pid(), + $return, errno_str($return)); +} +*/ +probe kernel.function("kernel_sendmsg").return +{ + if ($return < 0) + printf("kernel_sendmsg: %s(%d): status %d (%s)\n", execname(), pid(), + $return, errno_str($return)); +} +/* probe module("sunrpc").function("xs_udp_send_request") { printf("xs_udp_send_request: task %p\n", $task); @@ -45,6 +85,7 @@ probe module("sunrpc").function("xs_bind4").return { printf("xs_bind4: %d %s\n", $return, errno_str($return)); } +*/ probe begin { log("starting xprt probe") } probe end { log("ending xprt probe") } diff --git a/tapset/task.stp b/tapset/task.stp index 6b121be..1500a4d 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -8,17 +8,36 @@ function task_dump:string(_task:long) %{ struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); - char buf[MAXSTRINGLEN]; + char buf[64]; int cc=0; if (task <= 0) { sprintf(buf+cc, "task NULL"); } else { - sprintf(buf+cc, "task %p tk_pid %d tk_status %d\n", + sprintf(buf+cc, ": task 0x%p tk_pid %d tk_status %d", task, task->tk_pid, task->tk_status); cc = strlen(buf); } - snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); + snprintf(THIS->__retvalue, 64, "%s", buf); + + CATCH_DEREF_FAULT(); +%} +function xprt_dump:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_rqst *req = (struct rpc_rqst *)(long) kread(&(task->tk_rqstp)); + struct rpc_xprt *xprt = (struct rpc_xprt *)(long) kread(&(req->rq_xprt)); + char buf[64]; + int cc=0; + + if (task <= 0) { + sprintf(buf+cc, "task NULL"); + } else { + sprintf(buf+cc, ": xprt 0x%p ops 0x%p", + xprt, xprt->ops); + cc = strlen(buf); + } + snprintf(THIS->__retvalue, 64, "%s", buf); CATCH_DEREF_FAULT(); %} |
