From: Steve Dickson <SteveD@redhat.com>
To: Linux NFSv4 mailing list <nfsv4@linux-nfs.org>,
Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Cc: SystemTAP <systemtap@redhat.com>
Subject: [PATCH 5/5] NFS: Systemtap script
Date: Fri, 16 Jan 2009 11:33:56 -0500 [thread overview]
Message-ID: <4970B6F4.6080501@RedHat.com> (raw)
In-Reply-To: <4970B451.4080201@RedHat.com>
The systemtap scripts used to pull and parse the information
from the kernel.
Signed-off-by: Steve Dickson <steved@redhat.com>
--- /dev/null 2009-01-08 09:11:53.943261863 -0500
+++ linux/samples/nfs/nfs_mount.stp 2009-01-15 12:23:11.000000000 -0500
@@ -0,0 +1,160 @@
+%{
+#include <linux/mount.h>
+#include <linux/nfs_mount.h>
+%}
+
+function _fstype_name:string (_fstype:long) %{
+ struct file_system_type *fstype;
+ char *name;
+
+ fstype = (struct file_system_type *)(long)kread(&(THIS->_fstype));
+ name = (char *)(long)kread(&fstype->name);
+
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "name %s flags 0x%x",
+ name, fstype->fs_flags);
+
+ CATCH_DEREF_FAULT();
+%}
+function _vfsmnt_dump:string (_vfsmnt:long) %{
+ struct vfsmount *vfsmnt;
+ char *dev;
+
+ vfsmnt = (struct vfsmount *)(long)kread(&(THIS->_vfsmnt));
+ dev = (char *)(long)kread(&vfsmnt->mnt_devname);
+
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "dev %s flags=0x%x",
+ vfsmnt->mnt_devname, vfsmnt->mnt_flags);
+
+ CATCH_DEREF_FAULT();
+%}
+function _nfsmnt_dump:string (_nfsmnt:long) %{
+ struct nfs_mount_data *data;
+ unsigned char *bytes;
+
+ data = (struct nfs_mount_data *)(long)kread(&(THIS->_nfsmnt));
+ bytes = (unsigned char *)&data->addr.sin_addr.s_addr;
+
+ snprintf(THIS->__retvalue, MAXSTRINGLEN,
+ "vers %d flags 0x%x flavor %d hostname %s(%d.%d.%d.%d)",
+ data->version, data->flags, data->pseudoflavor,
+ data->hostname, bytes[0], bytes[1], bytes[2], bytes[3]);
+
+ CATCH_DEREF_FAULT();
+%}
+
+probe kernel.mark("nfs_mount") {
+ printf("nfs_mount:entry: fstype (%s) flags %x dev %s\n",
+ _fstype_name($arg1), $arg2, kernel_string($arg3));
+ printf("\tdata: %s\n\tmnt: %s\n",
+ _nfsmnt_dump($arg4), _vfsmnt_dump($arg5));
+
+}
+probe kernel.mark("nfs_mount_data_null") {
+ printf("nfs_mount: missing mount data: errno %d\n", $arg1);
+}
+probe kernel.mark("nfs_mount_data_badvers") {
+
+ if ($arg1 <= 0) {
+ printf("nfs_mount: invalid mount version: vers %d <= 0\n", $arg1);
+ } else {
+ printf("nfs_mount: invalid mount version: vers %d > %d\n",
+ $arg1, $arg2);
+ }
+}
+probe kernel.mark("nfs_mount_data_invalvers") {
+ if ($arg1 == 3) {
+ printf("nfs_mount: mount structure version %d does not support NFSv3\n", $arg1);
+ } else {
+ printf("nfs_mount: mount structure version %d does not support strong security\n", arg1)
+ }
+}
+probe kernel.mark("nfs_mount_data_noaddr") {
+ printf("nfs_mount: invalid server IP address:\n");
+}
+probe kernel.mark("nfs_mount_data_badsize") {
+ printf("nfs_mount: invalid root filehandle: fhsize %s > maxsize %d\n",
+ arg1, arg2);
+}
+probe kernel.mark("nfs_mount_get_root") {
+ printf("nfs_get_root: sb %p server %p mntfh %p\n", $arg1, $arg2, $arg3);
+}
+probe kernel.mark("nfs_mount_getroot_fhget1") {
+ printf("nfs_get_root: !s_root: nfs_fhget failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_mount_getroot_alloc1") {
+ printf("nfs_get_root: !s_root: d_alloc_root failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_mount_getroot_fhget2") {
+ printf("nfs_get_root: nfs_fhget failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_mount_getroot_alloc2") {
+ printf("nfs_get_root: d_alloc_root failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_mount_init_clnt") {
+ printf("nfs_init_client: nfs_create_rpc_client failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_create_rpc_client") {
+ printf("nfs_create_rpc_client: clp %p proto %d timeo %d retrans %d flavor %d",
+ $arg1, $arg2, $arg3, $arg4, $arg5);
+}
+probe kernel.mark("nfs_create_rpc_client_proto") {
+ printf("nfs_create_rpc_client: xprt_create_proto failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_create_rpc_client_client") {
+ printf("nfs_create_rpc_client: rpc_create_client failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_mount_init_srv") {
+ printf("nfs_init_server: nfs_get_client failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_mount_sget") {
+ printf("nfs_init_server: nfs_get_client failed: errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+
+probe kernel.mark("nfs_init_server_rpcclient") {
+ printf("nfs_init_server_rpcclient: server %p flavor %d\n",
+ $arg1, $arg2);
+}
+probe kernel.mark("nfs_init_server_rpcclient_clone") {
+ printf("nfs_init_server_rpcclient: rpc_clone_client failed errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_init_server_rpcclient_auth") {
+ printf("nfs_init_server_rpcclient: rpcauth_create failed errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_start_lockd") {
+ // struct nfs_server *server = $arg1;
+
+ printf("nfs_start_lockd: lockd_up_proto failed errno %d (%s)\n",
+ $arg2, errno_str($arg2));
+}
+probe kernel.mark("nfs_probe_fsinfo") {
+ printf("nfs_probe_fsinfo: server %p mntfh %p fattr %p\n",
+ $arg1, $arg2, $arg3);
+}
+probe kernel.mark("nfs_probe_fsinfo_setcaps") {
+ printf("nfs_probe_fsinfo: set_capabilities failed errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_probe_fsinfo_fsinfo") {
+ printf("nfs_probe_fsinfo: fsinfo failed errno %d (%s)\n",
+ $arg1, errno_str($arg1));
+}
+probe kernel.mark("nfs_create_server") {
+ // struct nfs_server *server = $arg1;
+ // struct nfs_fh *mntfh = $arg2;
+
+ printf("nfs_create_server: getattr failed errno %d (%s)\n",
+ $arg3, errno_str($arg3));
+}
+probe begin { log("starting nfs_mount trace") }
+probe end { log("ending nfs_mount trace") }
prev parent reply other threads:[~2009-01-16 16:33 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 16:22 [RFC][PATCH 0/5] NFS: trace points added to mounting path Steve Dickson
[not found] ` <4970B451.4080201-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-01-16 16:25 ` [PATCH 1/5] NFS: Adding trace points to fs/nfs/getroot.c Steve Dickson
2009-01-16 16:28 ` [PATCH 2/5] NFS: Adding trace points to fs/nfs/super.c Steve Dickson
2009-01-16 18:52 ` [RFC][PATCH 0/5] NFS: trace points added to mounting path Chuck Lever
2009-01-21 17:13 ` Steve Dickson
[not found] ` <497757D1.7090908-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-01-21 18:01 ` Chuck Lever
2009-01-21 19:29 ` Trond Myklebust
2009-01-21 19:58 ` Steve Dickson
2009-01-21 20:23 ` Trond Myklebust
2009-01-22 13:07 ` Steve Dickson
[not found] ` <49786F9F.7030400-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-01-22 15:30 ` Trond Myklebust
2009-01-22 15:49 ` Steve Dickson
2009-01-22 17:47 ` Arnaldo Carvalho de Melo
2009-01-21 19:37 ` Steve Dickson
2009-01-21 20:19 ` Chuck Lever
2009-01-21 22:36 ` Greg Banks
[not found] ` <4977A385.8000406-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2009-01-21 22:47 ` Arnaldo Carvalho de Melo
2009-01-21 22:57 ` Trond Myklebust
2009-01-21 23:06 ` Arnaldo Carvalho de Melo
2009-01-21 22:56 ` Trond Myklebust
2009-01-21 23:11 ` Greg Banks
2009-01-21 23:47 ` Trond Myklebust
2009-01-22 0:53 ` Frank Ch. Eigler
2009-01-22 2:04 ` Greg Banks
[not found] ` <4977D431.1020906-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2009-01-22 15:27 ` Steve Dickson
[not found] ` <49789073.1080200-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-01-22 22:43 ` Greg Banks
2009-01-21 22:56 ` J. Bruce Fields
2009-01-21 23:05 ` Muntz, Daniel
2009-01-22 15:59 ` Steve Dickson
2009-01-22 16:45 ` J. Bruce Fields
2009-01-22 22:54 ` Greg Banks
[not found] ` <4978F91C.4090208-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2009-01-23 18:09 ` J. Bruce Fields
2009-01-23 22:18 ` Greg Banks
2009-01-23 18:17 ` Chuck Lever
2009-01-22 13:55 ` Steve Dickson
2009-01-22 22:31 ` Greg Banks
2009-01-21 21:26 ` Greg Banks
2009-01-22 15:19 ` Steve Dickson
2009-01-23 18:28 ` Chuck Lever
2009-01-23 22:21 ` Greg Banks
2009-01-16 23:44 ` Greg Banks
[not found] ` <49711BDF.3010605-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2009-01-17 16:15 ` Frank Ch. Eigler
[not found] ` <4972A8F5.7070806@opengridcomputing.com>
2009-01-18 17:47 ` Frank Ch. Eigler
[not found] ` <y0mmydpucww.fsf-vo4H8ooykKW2oG+2xah3EoGKTjYczspe@public.gmane.org>
2009-01-18 23:12 ` Greg Banks
[not found] ` <4973B777.2000102-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2009-01-19 15:41 ` Frank Ch. Eigler
2009-01-19 23:13 ` Greg Banks
2009-01-19 14:27 ` Jeff Moyer
[not found] ` <x49ab9ntlpp.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2009-01-19 19:49 ` Jason Baron
2009-01-19 22:58 ` Greg Banks
2009-01-21 10:13 ` K.Prasad
2009-01-21 16:39 ` Steve Dickson
[not found] ` <49774FDC.5090307-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-01-21 17:04 ` Arnaldo Carvalho de Melo
2009-01-21 19:59 ` Steve Dickson
[not found] ` <20090121170401.GD4394-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2009-01-21 20:39 ` Christoph Hellwig
2009-01-18 16:40 ` Christoph Hellwig
2009-01-16 16:30 ` [PATCH 3/5] NFS: Adding trace points to nfs/client.c Steve Dickson
2009-01-16 16:32 ` [PATCH 4/5] NFS: Convert trace points to trace markers Steve Dickson
2009-01-16 16:33 ` Steve Dickson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4970B6F4.6080501@RedHat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
--cc=systemtap@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox