diff options
author | Josh Stone <jistone@redhat.com> | 2009-03-10 15:46:21 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-03-10 15:46:21 -0700 |
commit | 6351f32433edb111b28362963c97d1cd0d1d8561 (patch) | |
tree | d4c922167996a23b5fc6f7888bb12846c34c2c8a /tapset/nfs.stp | |
parent | abb41d920aecf908a132597f0a4bc26a10e58a7c (diff) | |
download | systemtap-steved-6351f32433edb111b28362963c97d1cd0d1d8561.tar.gz systemtap-steved-6351f32433edb111b28362963c97d1cd0d1d8561.tar.xz systemtap-steved-6351f32433edb111b28362963c97d1cd0d1d8561.zip |
PR9932: use @cast module search path
The nfs, rpc, and scsi tapsets use @cast on types that may be compiled
into a kernel module or into the main kernel binary. The @cast search
path separated with colons lets us search both the kernel and the module.
For a couple of cases, I also merged sequential @casts that work just
fine as a single cast with a multiple-level dereference.
Diffstat (limited to 'tapset/nfs.stp')
-rw-r--r-- | tapset/nfs.stp | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/tapset/nfs.stp b/tapset/nfs.stp index fe25eff2..6752747f 100644 --- a/tapset/nfs.stp +++ b/tapset/nfs.stp @@ -137,11 +137,10 @@ function __nfs_wpages:long(inode:long) %{ /* pure */ /*Get struct inode from struct page*/ function __p2i :long(page:long) { - mapping = page? @cast(page, "page", "kernel")->mapping : 0 + mapping = page? @cast(page, "page", "kernel:nfs")->mapping : 0 if (mapping == 0) return 0 - else - return @cast(mapping, "address_space", "kernel")->host + return @cast(mapping, "address_space", "kernel:nfs")->host } /*Get i_flags from struct page*/ @@ -150,8 +149,7 @@ function __p2i_flag : long (page:long) host = __p2i(page) if (host == 0) return -1 - else - return @cast(host, "inode", "kernel")->i_flags + return @cast(host, "inode", "kernel:nfs")->i_flags } /*Get i_state from struct page*/ @@ -160,8 +158,7 @@ function __p2i_state :long (page:long) host = __p2i(page) if (host == 0) return -1 - else - return @cast(host, "inode", "kernel")->i_state + return @cast(host, "inode", "kernel:nfs")->i_state } /*Get i_size from struct page*/ @@ -170,19 +167,17 @@ function __p2i_size :long (page:long) host = __p2i(page) if (host == 0) return -1 - else - return @cast(host, "inode", "kernel")->i_size + return @cast(host, "inode", "kernel:nfs")->i_size } /*Get s_flags from struct page*/ function __p2sb_flag:long (page:long) { host = __p2i(page) - i_sb = host? @cast(host, "inode", "kernel")->i_sb : 0 + i_sb = host? @cast(host, "inode", "kernel:nfs")->i_sb : 0 if (i_sb == 0) return -1 - else - return @cast(i_sb, "super_block", "kernel")->s_flags + return @cast(i_sb, "super_block", "kernel:nfs")->s_flags } function __d_loff_t :long (ppos :long) %{ /* pure */ @@ -198,14 +193,13 @@ function __d_loff_t :long (ppos :long) %{ /* pure */ function __file_inode:long (file:long) { %( kernel_v >= "2.6.20" %? - dentry = file? @cast(file, "file", "kernel")->f_path->dentry : 0 + dentry = file? @cast(file, "file", "kernel:nfs")->f_path->dentry : 0 %: - dentry = file? @cast(file, "file", "kernel")->f_dentry : 0 + dentry = file? @cast(file, "file", "kernel:nfs")->f_dentry : 0 %) if (dentry == 0) return 0 - else - return @cast(dentry, "dentry", "kernel")->d_inode + return @cast(dentry, "dentry", "kernel:nfs")->d_inode } function __file_id:long (file:long) @@ -213,10 +207,7 @@ function __file_id:long (file:long) d_inode = __file_inode(file) if (d_inode == 0) return 0 - else { - i_sb = @cast(d_inode, "inode", "kernel")->i_sb - return @cast(i_sb, "super_block", "kernel")->s_id - } + return @cast(d_inode, "inode", "kernel:nfs")->i_sb->s_id } function __file_mode:long (file:long) @@ -224,24 +215,21 @@ function __file_mode:long (file:long) d_inode = __file_inode(file) if (d_inode == 0) return 0 - else - return @cast(d_inode, "inode", "kernel")->i_mode + return @cast(d_inode, "inode", "kernel:nfs")->i_mode } function __file_parentname:string (file:long) { %( kernel_v >= "2.6.20" %? - dentry = file? @cast(file, "file", "kernel")->f_path->dentry : 0 + dentry = file? @cast(file, "file", "kernel:nfs")->f_path->dentry : 0 %: - dentry = file? @cast(file, "file", "kernel")->f_dentry : 0 + dentry = file? @cast(file, "file", "kernel:nfs")->f_dentry : 0 %) - d_parent = dentry? @cast(dentry, "dentry", "kernel")->d_parent : 0 + d_parent = dentry? @cast(dentry, "dentry", "kernel:nfs")->d_parent : 0 if (d_parent == 0) return "NULL" - else { - name = @cast(d_parent, "dentry", "kernel")->d_name->name - return kernel_string(name) - } + name = @cast(d_parent, "dentry", "kernel:nfs")->d_name->name + return kernel_string(name) } /* @@ -336,8 +324,8 @@ probe nfs.fop.llseek = kernel.function ("nfs_file_llseek") !, { dev = __file_dev($filp) ino = __file_ino($filp) - s_id = __file_id($filp) - devname = kernel_string(s_id) + s_id = __file_id($filp) + devname = kernel_string(s_id) maxbyte = __file_maxbytes($filp) offset = $offset |