diff options
| author | Steve Dickson <steved@redhat.com> | 2008-02-01 12:39:35 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2008-02-01 12:39:35 -0500 |
| commit | 5d0ba22f898aeaa42b2769875ecba1f63f7fec64 (patch) | |
| tree | 1c99ac3ddf616ff67475cd31058f1c68bf4ee7e4 | |
| parent | 61f3bef75ff080363b2d4521b114b0290d28266c (diff) | |
| download | systemtap-5d0ba22f898aeaa42b2769875ecba1f63f7fec64.tar.gz systemtap-5d0ba22f898aeaa42b2769875ecba1f63f7fec64.tar.xz systemtap-5d0ba22f898aeaa42b2769875ecba1f63f7fec64.zip | |
Added nfs4_lookup_root and nfs_fh parsing
| -rw-r--r-- | nfs4_lookup_root.stp | 19 | ||||
| -rw-r--r-- | tapset/nfs_fh.stp | 41 |
2 files changed, 60 insertions, 0 deletions
diff --git a/nfs4_lookup_root.stp b/nfs4_lookup_root.stp new file mode 100644 index 0000000..592af25 --- /dev/null +++ b/nfs4_lookup_root.stp @@ -0,0 +1,19 @@ +global lookup_root_fh + +probe module("nfs").function("nfs4_lookup_root") +{ + printf("nfs4_lookup_root: server %p fhandle %p info %p\n", + $server, $fhandle, $info); + lookup_root_fh = $fhandle; +} +probe module("nfs").function("nfs4_lookup_root").return +{ + if ($return) { + printf("nfs4_lookup_root: %d\n", $return); + } else { + printf("nfs4_lookup_root: %s\n", nfsfh(lookup_root_fh)); + } +} + +probe begin { log("starting nfs4_lookup_root probe") } +probe end { log("ending nfs4_lookup_root probe") } diff --git a/tapset/nfs_fh.stp b/tapset/nfs_fh.stp new file mode 100644 index 0000000..f4f21d4 --- /dev/null +++ b/tapset/nfs_fh.stp @@ -0,0 +1,41 @@ + +%{ +#include <linux/nfs.h> +%} + + +function nfsfh:string(_nfsfh:long) +%{ + struct nfs_fh *fh = (struct nfs_fh *)(long) kread(&(THIS->_nfsfh)); + char buf[MAXSTRINGLEN], *str, octet[10]; + int cc=0, i, j; + + unsigned short ofs, len; + + sprintf(buf+cc, "fh: %d: ", fh->size); + cc = strlen(buf); + + str = buf+cc; + len = fh->size; + for (ofs = 0; ofs < len; ofs += 16) { + /* + sprintf(str, "%03d: ", ofs ); + */ + for (i=0; i < 16; i++) { + if ((i + ofs) < len) + sprintf(octet, "%02x", fh->data[ofs + i]); + else + strcpy(octet, " "); + strcat(str, octet); + } + /* + strcat(str, " \n"); + */ + j = strlen(str); + str += j; + } + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); + + CATCH_DEREF_FAULT(); +%} |
