+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)
+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:
/* 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 {
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,
+// 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>
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);
}
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();
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 {
+// 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>
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
-# 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>
module("sunrpc").function("__rpc_execute").return ?
{
name = "sunrpc.sched.execute"
+
+%( kernel_v <= "2.6.20" %?
retstr = returnstr($return)
+%:
+ retstr = "N/A"
+%)
}
/*
%{
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();
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();
%}
+// 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 */
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));
}
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));
}
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();
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));
}
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 {