diff options
-rw-r--r-- | tapset/ChangeLog | 10 | ||||
-rw-r--r-- | tapset/LKET/Changelog | 8 | ||||
-rwxr-xr-x | tapset/LKET/nfs.stp | 4 | ||||
-rwxr-xr-x | tapset/LKET/rpc.stp | 4 | ||||
-rw-r--r-- | tapset/nfs.stp | 32 | ||||
-rw-r--r-- | tapset/nfsd.stp | 13 | ||||
-rw-r--r-- | tapset/rpc.stp | 35 | ||||
-rw-r--r-- | tapset/vfs.stp | 38 |
8 files changed, 109 insertions, 35 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 20cbc82f..4b122b56 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,13 @@ +2007-03-09 Pierre Peiffer <pierre.peiffer@bull.net> + + * nfsd.stp (nfsd.dispatch): Change initialization of variable + client_ip with a call to addr_from_rqst. + * rpc.stp (addr_from_rqst): - update with changes in struct svc_rqst + - __rpc_execute returns void now. struct rpc_xprt modified since + kernel 2.6.19. + * nfs.stp, vfs.stp: Local variables f_dentry renamed, because + conflicting with a new #define in kernel header linux/fs.h in 2.6.20. + 2007-02-29 David Wilder <dwilder@us.ibm.com> *conversions.stp (kernel_int) added goto success; (PR 4419) diff --git a/tapset/LKET/Changelog b/tapset/LKET/Changelog index 9f267636..342e2a54 100644 --- a/tapset/LKET/Changelog +++ b/tapset/LKET/Changelog @@ -1,3 +1,11 @@ +2007-03-09 Pierre Peiffer <pierre.peiffer@bull.net> + + * nfs.stp: Local variables f_dentry renamed, because conflicting + with a new #define in kernel header linux/fs.h in 2.6.20. + + * rpc.stp (_addevent.sunrpc.sched.execute.return): + update with __rpc_execute which returns void since kernel 2.6.21. + 2007-02-06 Josh Stone <joshua.i.stone@intel.com> * nfs.stp, nfs_proc.stp, nfsd.stp, process.stp, tskdispatch.stp: diff --git a/tapset/LKET/nfs.stp b/tapset/LKET/nfs.stp index 7267da74..63852d61 100755 --- a/tapset/LKET/nfs.stp +++ b/tapset/LKET/nfs.stp @@ -1,8 +1,8 @@ /* Helper functions */ function __file_fsname:string (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - struct inode *d_inode = f_dentry? kread(&(f_dentry->d_inode)) : NULL; + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + struct inode *d_inode = dentry? kread(&(dentry->d_inode)) : NULL; if (d_inode == NULL) strlcpy(THIS->__retvalue, "NULL", MAXSTRINGLEN); else { diff --git a/tapset/LKET/rpc.stp b/tapset/LKET/rpc.stp index f78b585d..b9c8ca60 100755 --- a/tapset/LKET/rpc.stp +++ b/tapset/LKET/rpc.stp @@ -697,7 +697,11 @@ probe addevent.sunrpc.sched.execute.return probe _addevent.sunrpc.sched.execute.return = sunrpc.sched.execute.return { +%( kernel_v <= "2.6.20" %? log_sunrpc_return_int64(HOOKID_SUNRPC_SCHED_EXECUTE_RETURN, $return) +%: + log_sunrpc_return_void(HOOKID_SUNRPC_SCHED_EXECUTE_RETURN) +%) } function log_sunrpc_execute(hookid:long, xid:long, prog:long, vers:long, diff --git a/tapset/nfs.stp b/tapset/nfs.stp index 083688ca..cbbaf78e 100644 --- a/tapset/nfs.stp +++ b/tapset/nfs.stp @@ -1,3 +1,13 @@ +// nfs tapset +// Copyright (C) 2006-2007 IBM Corp. +// Copyright (C) 2007 Intel Corporation. +// Copyright (C) 2007 Bull S.A.S +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + %{ #include <linux/kernel.h> #include <linux/nfs_fs.h> @@ -197,21 +207,21 @@ function __d_loff_t :long (ppos :long) %{ /* pure */ function __file_inode:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) THIS->__retvalue = 0; else - THIS->__retvalue = (long)kread(&(f_dentry->d_inode)); + THIS->__retvalue = (long)kread(&(dentry->d_inode)); CATCH_DEREF_FAULT(); %} function __file_id:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) THIS->__retvalue = 0; else { - struct inode *d_inode = kread(&(f_dentry->d_inode)); + struct inode *d_inode = kread(&(dentry->d_inode)); struct super_block *i_sb = kread(&(d_inode->i_sb)); THIS->__retvalue = (long)&(i_sb->s_id); } @@ -220,11 +230,11 @@ function __file_id:long (file:long) %{ /* pure */ function __file_mode:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) THIS->__retvalue = 0; else { - struct inode *d_inode = kread(&(f_dentry->d_inode)); + struct inode *d_inode = kread(&(dentry->d_inode)); THIS->__retvalue = kread(&(d_inode->i_mode)); } CATCH_DEREF_FAULT(); @@ -232,8 +242,8 @@ function __file_mode:long (file:long) %{ /* pure */ function __file_parentname:string (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - struct dentry *d_parent = f_dentry? kread(&(f_dentry->d_parent)) : NULL; + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + struct dentry *d_parent = dentry? kread(&(dentry->d_parent)) : NULL; if (d_parent == NULL) strlcpy(THIS->__retvalue, "NULL", MAXSTRINGLEN); else { diff --git a/tapset/nfsd.stp b/tapset/nfsd.stp index 49f04f51..699ab17e 100644 --- a/tapset/nfsd.stp +++ b/tapset/nfsd.stp @@ -1,3 +1,14 @@ +// nfs tapset +// Copyright (C) 2006-2007 IBM Corp. +// Copyright (C) 2007 Intel Corporation. +// Copyright (C) 2007 Bull S.A.S +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + + %{ #include <linux/sunrpc/svc.h> #include <linux/nfsd/nfsd.h> @@ -131,7 +142,7 @@ function p_long:long(cnt:long) %{ /* pure */ probe nfsd.dispatch = kernel.function("nfsd_dispatch")?, module("nfsd").function("nfsd_dispatch") ? { - client_ip = $rqstp->rq_addr->sin_addr->s_addr + client_ip = addr_from_rqst($rqstp) proto = $rqstp->rq_prot version = $rqstp->rq_vers diff --git a/tapset/rpc.stp b/tapset/rpc.stp index 7a1c978d..d3b0606f 100644 --- a/tapset/rpc.stp +++ b/tapset/rpc.stp @@ -1,9 +1,11 @@ -# Copyright (C) 2006 IBM Corp. -# -# This file is part of systemtap, and is free software. You can -# redistribute it and/or modify it under the terms of the GNU General -# Public License (GPL); either version 2, or (at your option) any -# later version. +// rpc tapset +// Copyright (C) 2006 IBM Corp. +// Copyright (C) 2007 Bull S.A.S +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. %{ #include <linux/kernel.h> @@ -777,7 +779,12 @@ probe sunrpc.sched.execute.return = kernel.function("__rpc_execute").return ?, module("sunrpc").function("__rpc_execute").return ? { name = "sunrpc.sched.execute" + +%( kernel_v <= "2.6.20" %? retstr = returnstr($return) +%: + retstr = "N/A" +%) } /* @@ -879,9 +886,17 @@ function port_from_clnt:long(clnt:long) %{ struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt; struct rpc_xprt *cl_xprt = clnt? kread(&(clnt->cl_xprt)) : NULL; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) + if (cl_xprt && kread(&(cl_xprt->addr.ss_family)) == AF_INET) { + /* Now consider ipv4 only */ + struct sockaddr_in *sap = (struct sockaddr_in *) &cl_xprt->addr; + + THIS->__retvalue = ntohs(kread(&(sap->sin_port))); +#else if (cl_xprt && kread(&(cl_xprt->addr.sin_family)) == AF_INET) { /* Now consider ipv4 only */ THIS->__retvalue = ntohs(kread(&(cl_xprt->addr.sin_port))); +#endif } else THIS->__retvalue = 0; CATCH_DEREF_FAULT(); @@ -926,7 +941,13 @@ function vers_from_prog:long(program:long, vers:long) function addr_from_rqst:long(rqstp:long) %{ struct svc_rqst *rqstp = (struct svc_rqst *)(long)THIS->rqstp; - THIS->__retvalue = rqstp ? kread(&(rqstp->rq_addr.sin_addr.s_addr)) : 0; + + if (rqstp) { + struct sockaddr_in *sin = (struct sockaddr_in *) &rqstp->rq_addr; + + THIS->__retvalue = kread(&sin->sin_addr.s_addr); + } else + THIS->__retvalue = 0; CATCH_DEREF_FAULT(); %} diff --git a/tapset/vfs.stp b/tapset/vfs.stp index e10a2ed5..9ecce3cb 100644 --- a/tapset/vfs.stp +++ b/tapset/vfs.stp @@ -1,3 +1,13 @@ +// vfs tapset +// Copyright (C) 2006-2007 IBM Corp. +// Copyright (C) 2007 Intel Corporation. +// Copyright (C) 2007 Bull S.A.S +// +// This file is part of systemtap, and is free software. You can +// redistribute it and/or modify it under the terms of the GNU General +// Public License (GPL); either version 2, or (at your option) any +// later version. + /* generic vfs probes */ /* helper functions */ @@ -81,11 +91,11 @@ function __page_bdev:long (page:long) %{ /* pure */ function __file_dev:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) { + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) { THIS->__retvalue = 0; } else { - struct inode *d_inode = kread(&(f_dentry->d_inode)); + struct inode *d_inode = kread(&(dentry->d_inode)); struct super_block *i_sb = kread(&(d_inode->i_sb)); THIS->__retvalue = kread(&(i_sb->s_dev)); } @@ -94,11 +104,11 @@ function __file_dev:long (file:long) %{ /* pure */ function __file_bdev:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) { + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) { THIS->__retvalue = 0; } else { - struct inode *d_inode = kread(&(f_dentry->d_inode)); + struct inode *d_inode = kread(&(dentry->d_inode)); struct super_block *i_sb = kread(&(d_inode->i_sb)); THIS->__retvalue = (long)kread(&(i_sb->s_bdev)); } @@ -107,11 +117,11 @@ function __file_bdev:long (file:long) %{ /* pure */ function __file_ino:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) { + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) { THIS->__retvalue = 0; } else { - struct inode *d_inode = kread(&(f_dentry->d_inode)); + struct inode *d_inode = kread(&(dentry->d_inode)); THIS->__retvalue = kread(&(d_inode->i_ino)); } CATCH_DEREF_FAULT(); @@ -119,11 +129,11 @@ function __file_ino:long (file:long) %{ /* pure */ function __file_maxbytes:long (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - if (f_dentry == NULL) { + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + if (dentry == NULL) { THIS->__retvalue = 0; } else { - struct inode *d_inode = kread(&(f_dentry->d_inode)); + struct inode *d_inode = kread(&(dentry->d_inode)); struct super_block *i_sb = kread(&(d_inode->i_sb)); THIS->__retvalue = kread(&(i_sb->s_maxbytes)); } @@ -132,8 +142,8 @@ function __file_maxbytes:long (file:long) %{ /* pure */ function __file_filename:string (file:long) %{ /* pure */ struct file *file = (struct file *)(long)THIS->file; - struct dentry *f_dentry = file? kread(&(file->f_dentry)) : NULL; - const unsigned char *name = f_dentry? kread(&(f_dentry->d_name.name)) : NULL; + struct dentry *dentry = file? kread(&(file->f_dentry)) : NULL; + const unsigned char *name = dentry? kread(&(dentry->d_name.name)) : NULL; if (name == NULL) { strlcpy(THIS->__retvalue, "NULL", MAXSTRINGLEN); } else { |