diff options
| author | Steve Dickson <steved@redhat.com> | 2009-11-04 14:31:43 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2009-11-04 14:31:43 -0500 |
| commit | 699d90303bbc79921b04484e3274f9272b1c5448 (patch) | |
| tree | 206b84e9fe7bf6edcb185dfeb2234d7b4f31990c /tapset | |
| parent | 6e6288680658609527f52a876ff40587a2b21b3f (diff) | |
| parent | 9ee2ff20970057642b8f08407ac47252619bea04 (diff) | |
| download | systemtap-699d90303bbc79921b04484e3274f9272b1c5448.tar.gz systemtap-699d90303bbc79921b04484e3274f9272b1c5448.tar.xz systemtap-699d90303bbc79921b04484e3274f9272b1c5448.zip | |
Merge branch 'master' of git://fedorapeople.org/~steved/systemtap
Diffstat (limited to 'tapset')
| -rw-r--r-- | tapset/acl.stp | 27 | ||||
| -rw-r--r-- | tapset/fs.stp | 8 | ||||
| -rw-r--r-- | tapset/inode.stp | 13 | ||||
| -rw-r--r-- | tapset/task.stp | 102 |
4 files changed, 150 insertions, 0 deletions
diff --git a/tapset/acl.stp b/tapset/acl.stp new file mode 100644 index 0000000..ad9f88d --- /dev/null +++ b/tapset/acl.stp @@ -0,0 +1,27 @@ +%{ +#include <linux/kernel.h> +#include <linux/posix_acl.h> +%} + +function acl_dump:string(_acl:long) +%{ + struct posix_acl *acl = (struct posix_acl *)(long) kread(&(THIS->_acl)); + struct posix_acl_entry *pa; + char buf[MAXSTRINGLEN]; + int cc=0, i; + + sprintf(buf+cc, "acl(%d) ", acl->a_count); + cc = strlen(buf); + pa = acl->a_entries; + + for (i=0; i < acl->a_count; i++) { + + sprintf(buf+cc, "[%d,%d,%d] ", pa->e_tag, pa->e_perm, pa->e_id); + cc = strlen(buf); + + pa++; + } + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/fs.stp b/tapset/fs.stp index 85956e9..f8122bf 100644 --- a/tapset/fs.stp +++ b/tapset/fs.stp @@ -31,3 +31,11 @@ function file2name:string(filep:long) CATCH_DEREF_FAULT(); %} +function dentry2name:string(dentry_:long) +%{ + struct dentry *dentry = (struct dentry *)(long) kread(&(THIS->dentry_)); + + strlcpy(THIS->__retvalue, dentry->d_name.name, MAXSTRINGLEN); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/inode.stp b/tapset/inode.stp new file mode 100644 index 0000000..106cba1 --- /dev/null +++ b/tapset/inode.stp @@ -0,0 +1,13 @@ +%{ +#include <linux/kernel.h> +%} + +function inode_uid:string(_ino:long) +%{ + struct inode *inode = (struct inode *)(long) kread(&(THIS->_ino)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "uid=%d gid=%d", + inode->i_uid, inode->i_gid); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/task.stp b/tapset/task.stp index d409a96..6b121be 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -1,6 +1,7 @@ %{ #include <linux/kernel.h> #include <linux/sunrpc/clnt.h> +#include <linux/sunrpc/sched.h> #include <linux/sunrpc/svc.h> %} @@ -21,3 +22,104 @@ function task_dump:string(_task:long) CATCH_DEREF_FAULT(); %} +function task_status:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + + THIS->__retvalue = task->tk_status; + + CATCH_DEREF_FAULT(); +%} + +function cl_prognum:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + + THIS->__retvalue = clnt->cl_prog; + + CATCH_DEREF_FAULT(); +%} + +function cl_vers:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + + THIS->__retvalue = clnt->cl_vers; + + CATCH_DEREF_FAULT(); +%} + +function cl_prog:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + struct rpc_procinfo *proc = + (struct rpc_procinfo *)(long) kread(&(clnt->cl_procinfo)); + char *p_name = kread(&(proc->p_name)); + static struct { + int prog; + char *string; + } prog_progtbl[] = { + {100000, "rpcbind"}, + {100024, "statd"}, + {100011, "rquotad"}, + {100003, "nfs"}, + {100021, "nlockmgr"}, + {100005, "mountd"}, + {100227, "nfs_acl"}, + }; + int i; + int tabsz = (sizeof(prog_progtbl)/sizeof(prog_progtbl[0])); + + for (i = 0; i < tabsz; i++) { + if (prog_progtbl[i].prog == clnt->cl_prog) { + break; + } + } + if (i == tabsz) + snprintf(THIS->__retvalue, MAXSTRINGLEN, "0x%x[%d]:%d", + clnt->cl_prog, clnt->cl_vers, proc->p_proc); + else + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s[%d]:%d", + prog_progtbl[i].string, clnt->cl_vers, proc->p_proc); + + CATCH_DEREF_FAULT(); +%} +function cl_server:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + char *cl_server = kread(&(clnt->cl_server)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", + cl_server ? cl_server : "NULL"); + + CATCH_DEREF_FAULT(); +%} +/* +function rpcprocnum:long(_msg:long) +%{ + struct rpc_message *msg = (struct rpc_message *)(long) kread(&(THIS->_msg)); + struct rpc_procinfo *rpc_proc = + (struct rpc_procinfo *)(long) kread(&(msg->rpc_proc)); + + THIS->__retvalue = rpc_proc->p_proc; + + CATCH_DEREF_FAULT(); +%} +function rpcprocname:string(_msg:long) +%{ + struct rpc_message *msg = (struct rpc_message *)(long) kread(&(THIS->_msg)); + struct rpc_procinfo *rpc_proc = + (struct rpc_procinfo *)(long) kread(&(msg->rpc_proc)); + char *p_name = kread(&(rpc_proc->p_name)); + char buf[MAXSTRINGLEN]; + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s(%d)", + p_name ? p_name : "NULL" , rpc_proc->p_proc); + + CATCH_DEREF_FAULT(); +%} +*/ |
