]> git.karo-electronics.de Git - linux-beck.git/blobdiff - fs/xfs/xfs_trace.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-beck.git] / fs / xfs / xfs_trace.h
index 53182f97cf011e62e4806ce4bf3dbdfc71f00835..152f82782630222321bcd234b20c0ffb0a626e34 100644 (file)
@@ -538,6 +538,64 @@ DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
 DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
 
+DECLARE_EVENT_CLASS(xfs_filestream_class,
+       TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
+       TP_ARGS(ip, agno),
+       TP_STRUCT__entry(
+               __field(dev_t, dev)
+               __field(xfs_ino_t, ino)
+               __field(xfs_agnumber_t, agno)
+               __field(int, streams)
+       ),
+       TP_fast_assign(
+               __entry->dev = VFS_I(ip)->i_sb->s_dev;
+               __entry->ino = ip->i_ino;
+               __entry->agno = agno;
+               __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
+       ),
+       TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 __entry->ino,
+                 __entry->agno,
+                 __entry->streams)
+)
+#define DEFINE_FILESTREAM_EVENT(name) \
+DEFINE_EVENT(xfs_filestream_class, name, \
+       TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
+       TP_ARGS(ip, agno))
+DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
+DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
+DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
+
+TRACE_EVENT(xfs_filestream_pick,
+       TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
+                xfs_extlen_t free, int nscan),
+       TP_ARGS(ip, agno, free, nscan),
+       TP_STRUCT__entry(
+               __field(dev_t, dev)
+               __field(xfs_ino_t, ino)
+               __field(xfs_agnumber_t, agno)
+               __field(int, streams)
+               __field(xfs_extlen_t, free)
+               __field(int, nscan)
+       ),
+       TP_fast_assign(
+               __entry->dev = VFS_I(ip)->i_sb->s_dev;
+               __entry->ino = ip->i_ino;
+               __entry->agno = agno;
+               __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
+               __entry->free = free;
+               __entry->nscan = nscan;
+       ),
+       TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 __entry->ino,
+                 __entry->agno,
+                 __entry->streams,
+                 __entry->free,
+                 __entry->nscan)
+);
+
 DECLARE_EVENT_CLASS(xfs_lock_class,
        TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
                 unsigned long caller_ip),