[Top] [All Lists]

Re: [PATCH 2/2] xfs: Nuke XFS_ERROR macro

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/2] xfs: Nuke XFS_ERROR macro
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 22 Apr 2014 09:43:17 +1000
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20140421065746.GA20384@xxxxxxxxxxxxx>
References: <534EC073.8090006@xxxxxxxxxxx> <534EC282.7010905@xxxxxxxxxxx> <20140416175117.GA23643@xxxxxxxxxxxxx> <534EC42D.1080704@xxxxxxxxxxx> <534ED5E4.60903@xxxxxxxxxxx> <20140416220807.GN15995@dastard> <20140416194444.50176f0f@xxxxxxxxxxxxxxxxxx> <20140417003956.GS15995@dastard> <20140421065746.GA20384@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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

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...


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>