lkml.org 
[lkml]   [2012]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] mm: trace filemap add and del
On Tue, Nov 20, 2012 at 03:57:35PM -0800, Andrew Morton wrote:
> On Thu, 8 Nov 2012 20:54:10 +0100
> Robert Jarzmik <robert.jarzmik@free.fr> wrote:
.....
> > + __field(dev_t, s_dev)
>
> Perhaps use super_block.s_id here
>
> > + ),
> > +
> > + TP_fast_assign(
> > + __entry->page = page;
> > + __entry->i_no = page->mapping->host->i_ino;
> > + __entry->pageofs = page->index;
> > + if (page->mapping->host->i_sb)
> > + __entry->s_dev = page->mapping->host->i_sb->s_dev;
> > + else
> > + __entry->s_dev = page->mapping->host->i_rdev;
>
> and hence avoid all this stuff.

We actually have an informal convention for formating filesystem
trace events, and that is to use the device number....

>
> > + ),
> > +
> > + TP_printk("page=%p pfn=%lu blk=%d:%d inode+ofs=%lu+%lu",

... and to prefix messages like:

TP_printk("dev %d:%d ino 0x%llx ....
MAJOR(__entry->dev), MINOR(__entry->dev),

i.e. the start of the event message has all the identifying
information where it is easy to grep for and get all the events for
a specific dev/inode combination without even having to think about
it.

XFS, ext3/4, jbd/jdb2 and gfs2 follow this convention, so we should
keep propagating that pattern in the name of consistency, rather
than having different trace formats for different parts of the
VFS/FS layers...

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com


\
 
 \ /
  Last update: 2012-11-21 05:21    [W:0.138 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site