From: Steve Dickson <SteveD@redhat.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: autofs mailing list <autofs@linux.kernel.org>,
Ian Kent <raven@themaw.net>
Subject: Re: [patch, rfc] autofs4: add trace points to the mount and unmount paths
Date: Tue, 30 Jun 2009 14:32:54 -0400 [thread overview]
Message-ID: <4A4A5A56.1040308@RedHat.com> (raw)
In-Reply-To: <x49fxdh3b0a.fsf@segfault.boston.devel.redhat.com>
Hey,
Comments in-line...
On 06/30/2009 01:08 PM, Jeff Moyer wrote:
> Hi, Ian,
>
> I got a fairly simply request from a customer. They wanted to use
> systemtap to track automounter mount and unmount activity.
> Unfortunately, the compiler inlined the expire functions I wanted to
> instrument, so I needed to add a tracepoint to get at useful
> information.
>
> This patch, then, adds a few trace points so that we don't have to worry
> about compiler inlining. I have an example script using these trace
> points that I'll be sending along to the systemtap mailing list
> shortly. Let me know what you think. If you're interested in trying it
> out, I've made my systemtap patch available at:
> http://people.redhat.com/jmoyer/systemtap
>
> You can try running testsuite/systemtap.examples/general/autofs.stp. It
> should run with or without the below patch applied, though the results
> are not as accurate (can't get full paths for unmounts) without the
> tracepoint in autofs4_do_expire_multi.
>
> Cheers,
> Jeff
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
> index aa39ae8..6c86df9 100644
> --- a/fs/autofs4/expire.c
> +++ b/fs/autofs4/expire.c
> @@ -13,6 +13,7 @@
> * ------------------------------------------------------------------------- */
>
> #include "autofs_i.h"
> +#include <trace/events/autofs4.h>
>
> static unsigned long now;
>
> @@ -496,6 +497,7 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
> /* This is synchronous because it makes the daemon a
> little easier */
> ret = autofs4_wait(sbi, dentry, NFY_EXPIRE);
> + trace_autofs4_do_expire_multi(mnt, dentry, ret);
>
> spin_lock(&sbi->fs_lock);
> if (ino->flags & AUTOFS_INF_MOUNTPOINT) {
> diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
> index b96a3c5..cbb17b7 100644
> --- a/fs/autofs4/root.c
> +++ b/fs/autofs4/root.c
> @@ -19,6 +19,9 @@
> #include <linux/time.h>
> #include "autofs_i.h"
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/events/autofs4.h>
> +
> static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *);
> static int autofs4_dir_unlink(struct inode *,struct dentry *);
> static int autofs4_dir_rmdir(struct inode *,struct dentry *);
> @@ -216,6 +219,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
> (!d_mountpoint(dentry) && __simple_empty(dentry))) {
> spin_unlock(&dcache_lock);
>
> + trace_autofs4_follow_link(nd, dentry);
> status = try_to_fill_dentry(dentry, 0);
Would it make sense to put the trace point after the
try_to_fill_dentry() so the status could be recorded in the
trace point? Similar to the trace point above?
> if (status)
> goto out_error;
> @@ -540,6 +544,8 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
> dput(expiring);
> }
>
> + trace_autofs4_lookup(nd, dentry);
Same kinda idea here... would it make sense to move this
trace point some where so the status can be recorded?
The main point with these two question is I have found it
very handy to write system tap scripts that only fire
when there is a non-zero status.... Which means instead
of getting pages and pages of info scrolling off the
screen, I get one (or few) lines of error conditions that
generally have a bit more meaning...
Just a suggestion...
steved.
next parent reply other threads:[~2009-06-30 18:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <x49fxdh3b0a.fsf@segfault.boston.devel.redhat.com>
2009-06-30 18:32 ` Steve Dickson [this message]
2009-06-30 18:40 ` [patch, rfc] autofs4: add trace points to the mount and unmount paths Jeff Moyer
2009-07-01 6:21 ` Ian Kent
2009-07-09 20:40 ` Jeff Moyer
2009-07-10 6:08 ` Ian Kent
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=4A4A5A56.1040308@RedHat.com \
--to=steved@redhat.com \
--cc=autofs@linux.kernel.org \
--cc=jmoyer@redhat.com \
--cc=raven@themaw.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.