summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-11-02 16:27:53 +0100
committerDavid Howells <dhowells@redhat.com>2017-11-13 16:38:21 +0100
commit13524ab3c6f41bcd257d28644414297bea8282b7 (patch)
tree9ac5ab8bfd44026bb13783cf540f4fdb57d72d44 /include/trace
parentafs: Implement shared-writeable mmap (diff)
downloadlinux-13524ab3c6f41bcd257d28644414297bea8282b7.tar.xz
linux-13524ab3c6f41bcd257d28644414297bea8282b7.zip
afs: Trace page dirty/clean
Add a trace event that logs the dirtying and cleaning of pages attached to AFS inodes. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/afs.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h
index 9cfb7657b72c..5f4e8193932d 100644
--- a/include/trace/events/afs.h
+++ b/include/trace/events/afs.h
@@ -402,6 +402,45 @@ TRACE_EVENT(afs_dir_check_failed,
__entry->vnode, __entry->off, __entry->i_size)
);
+/*
+ * We use page->private to hold the amount of the page that we've written to,
+ * splitting the field into two parts. However, we need to represent a range
+ * 0...PAGE_SIZE inclusive, so we can't support 64K pages on a 32-bit system.
+ */
+#if PAGE_SIZE > 32768
+#define AFS_PRIV_MAX 0xffffffff
+#define AFS_PRIV_SHIFT 32
+#else
+#define AFS_PRIV_MAX 0xffff
+#define AFS_PRIV_SHIFT 16
+#endif
+
+TRACE_EVENT(afs_page_dirty,
+ TP_PROTO(struct afs_vnode *vnode, const char *where,
+ pgoff_t page, unsigned long priv),
+
+ TP_ARGS(vnode, where, page, priv),
+
+ TP_STRUCT__entry(
+ __field(struct afs_vnode *, vnode )
+ __field(const char *, where )
+ __field(pgoff_t, page )
+ __field(unsigned long, priv )
+ ),
+
+ TP_fast_assign(
+ __entry->vnode = vnode;
+ __entry->where = where;
+ __entry->page = page;
+ __entry->priv = priv;
+ ),
+
+ TP_printk("vn=%p %lx %s %lu-%lu",
+ __entry->vnode, __entry->page, __entry->where,
+ __entry->priv & AFS_PRIV_MAX,
+ __entry->priv >> AFS_PRIV_SHIFT)
+ );
+
#endif /* _TRACE_AFS_H */
/* This part must be outside protection */