summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2009-12-21 13:05:10 -0500
committerSteve Dickson <steved@redhat.com>2009-12-21 13:05:10 -0500
commitcb79a3f04253b9cbda91241abadfc59ad8af38cf (patch)
tree866a411cba6c48813008b51fcc7377ea7ccc5f93
parenta2fd4a73d9fcf61e8bedc1476409fb19dfde5c5b (diff)
downloadsystemtap-cb79a3f04253b9cbda91241abadfc59ad8af38cf.tar.gz
systemtap-cb79a3f04253b9cbda91241abadfc59ad8af38cf.tar.xz
systemtap-cb79a3f04253b9cbda91241abadfc59ad8af38cf.zip
Added some cred debugging
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--sunrpc/auth.stp32
-rw-r--r--tapset/svc_cred.stp21
2 files changed, 53 insertions, 0 deletions
diff --git a/sunrpc/auth.stp b/sunrpc/auth.stp
new file mode 100644
index 0000000..e5330af
--- /dev/null
+++ b/sunrpc/auth.stp
@@ -0,0 +1,32 @@
+global rqstp
+probe module("sunrpc").function("svcauth_unix_accept")
+{
+ printf("svcauth_unix_accept: rqstp %p authp %p\n",
+ $rqstp, $authp);
+ rqstp = $rqstp;
+}
+probe module("sunrpc").function("svcauth_unix_accept").return
+{
+ if ($return == 5) {
+ printf("svcauth_unix_accept: %s\n", svc_creds(rqstp));
+ } else {
+ printf("svcauth_unix_accept: %s\n", svcerror($return));
+ }
+}
+probe module("auth_rpcgss").function("svcauth_gss_accept")
+{
+ printf("svcauth_gss_accept: rqstp %p authp %p\n",
+ $rqstp, $authp);
+ rqstp = $rqstp;
+}
+probe module("auth_rpcgss").function("svcauth_gss_accept").return
+{
+ if ($return == 5) {
+ printf("svcauth_gss_accept: %s\n", svc_creds(rqstp));
+ } else {
+ printf("svcauth_gss_accept: %s\n", svcerror($return));
+ }
+}
+
+probe begin { log("starting sunrpc auth probe") }
+probe end { log("ending sunrpc auth probe") }
diff --git a/tapset/svc_cred.stp b/tapset/svc_cred.stp
new file mode 100644
index 0000000..35e7d4d
--- /dev/null
+++ b/tapset/svc_cred.stp
@@ -0,0 +1,21 @@
+%{
+#include <linux/sunrpc/svc.h>
+#include <linux/sunrpc/cache.h>
+%}
+
+function svc_creds:string(_rqstp:long)
+%{
+ struct svc_rqst *rqstp =
+ (struct svc_rqst *)(long) kread(&(THIS->_rqstp));
+ char buf[MAXSTRINGLEN];
+ int cc=0;
+
+ sprintf(buf+cc, "cr_uid %d cr_gid %d", rqstp->rq_cred.cr_uid,
+ rqstp->rq_cred.cr_gid);
+ cc = strlen(buf);
+
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf);
+
+ CATCH_DEREF_FAULT();
+%}
+