From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Eric Sandeen <sandeen@sandeen.net>,
Steven Rostedt <rostedt@goodmis.org>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH 2/2] xfs: Nuke XFS_ERROR macro
Date: Tue, 22 Apr 2014 09:43:17 +1000 [thread overview]
Message-ID: <20140421234317.GF18672@dastard> (raw)
In-Reply-To: <20140421065746.GA20384@infradead.org>
On Sun, Apr 20, 2014 at 11:57:46PM -0700, Christoph Hellwig wrote:
> On Thu, Apr 17, 2014 at 10:39:56AM +1000, Dave Chinner wrote:
> > so, basically a script that does:
> >
> > #!/bin/bash
> >
> > TRACEDIR=/sys/kernel/debug/tracing
> >
> > grep -i 't xfs_' /proc/kallsyms | awk '{print $3}' ; while read F; do
> > echo "r:ret_$F $F \$retval" >> $TRACEDIR/kprobe_events
> > done
> >
> > for E in $TRACEDIR/events/kprobes/ret_xfs_*/enable; do
> > echo 1 > $E
> > done;
> >
> > echo 'arg1 > 0xffffffffffffff00' > $TRACEDIR/events/kprobes/filter
> >
> > for T in $TRACEDIR/events/kprobes/ret_xfs_*/trigger; do
> > echo 'traceoff if arg1 > 0xffffffffffffff00' > $T
> > done
>
> This looks incredibly useful! Can we throw this into Documentation/ as
> a helper script (and make the xfs a command line parameter so it's
> genericly useful)?
So does that mean you have no more objections to removing
XFS_ERROR()?
The thing is, that's a quick hack that spews errors all over the
place, especially if you run it twice. It needs a counterpart to
turn off the tracing, clean up the triggers, etc....
FWIW, what I'd really like is a trace event trigger that triggers
a BUG(), so that we can use it to drop into kernel debuggers or get
kdump to generate a core that can be analysed offline...
> One think that would be nice is to specify a module instead of relying
> on a clean namespace, but to replace the XFS functionality the one above
> is more than enough.
My current hack is invoked like this:
$ grep -i 't xfs_' /proc/kallsyms | retval_filter.sh
Makes it completely independent of how you supply the symbols to the
function. Hence my coments about how it'd be really cool to have
this built into in trace-cmd, because the mechanism is independent
of how you specify the function list...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-04-21 23:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 17:40 [PATCH 0/2] xfs: clean up return handling Eric Sandeen
2014-04-16 17:44 ` [PATCH 1/2] xfs: return is not a function Eric Sandeen
2014-04-21 6:58 ` Christoph Hellwig
2014-04-16 17:48 ` [PATCH 2/2] xfs: Nuke XFS_ERROR macro Eric Sandeen
2014-04-16 17:51 ` Christoph Hellwig
2014-04-16 17:55 ` Eric Sandeen
2014-04-16 19:11 ` Eric Sandeen
2014-04-16 22:08 ` Dave Chinner
2014-04-16 23:44 ` Steven Rostedt
2014-04-17 0:39 ` Dave Chinner
2014-04-17 0:49 ` Dave Chinner
2014-04-21 6:57 ` Christoph Hellwig
2014-04-21 23:43 ` Dave Chinner [this message]
2014-04-16 22:28 ` Dave Chinner
2014-04-22 21:38 ` Dave Chinner
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=20140421234317.GF18672@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sandeen@sandeen.net \
--cc=xfs@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).