2 #define TRACE_SYSTEM filemap
4 #if !defined(_TRACE_FILEMAP_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_FILEMAP_H
7 #include <linux/types.h>
8 #include <linux/tracepoint.h>
10 #include <linux/memcontrol.h>
11 #include <linux/device.h>
12 #include <linux/kdev_t.h>
13 #include <linux/errseq.h>
15 DECLARE_EVENT_CLASS(mm_filemap_op_page_cache
,
17 TP_PROTO(struct page
*page
),
22 __field(unsigned long, pfn
)
23 __field(unsigned long, i_ino
)
24 __field(unsigned long, index
)
29 __entry
->pfn
= page_to_pfn(page
);
30 __entry
->i_ino
= page
->mapping
->host
->i_ino
;
31 __entry
->index
= page
->index
;
32 if (page
->mapping
->host
->i_sb
)
33 __entry
->s_dev
= page
->mapping
->host
->i_sb
->s_dev
;
35 __entry
->s_dev
= page
->mapping
->host
->i_rdev
;
38 TP_printk("dev %d:%d ino %lx page=%p pfn=%lu ofs=%lu",
39 MAJOR(__entry
->s_dev
), MINOR(__entry
->s_dev
),
41 pfn_to_page(__entry
->pfn
),
43 __entry
->index
<< PAGE_SHIFT
)
46 DEFINE_EVENT(mm_filemap_op_page_cache
, mm_filemap_delete_from_page_cache
,
47 TP_PROTO(struct page
*page
),
51 DEFINE_EVENT(mm_filemap_op_page_cache
, mm_filemap_add_to_page_cache
,
52 TP_PROTO(struct page
*page
),
56 TRACE_EVENT(filemap_set_wb_err
,
57 TP_PROTO(struct address_space
*mapping
, errseq_t eseq
),
59 TP_ARGS(mapping
, eseq
),
62 __field(unsigned long, i_ino
)
64 __field(errseq_t
, errseq
)
68 __entry
->i_ino
= mapping
->host
->i_ino
;
69 __entry
->errseq
= eseq
;
70 if (mapping
->host
->i_sb
)
71 __entry
->s_dev
= mapping
->host
->i_sb
->s_dev
;
73 __entry
->s_dev
= mapping
->host
->i_rdev
;
76 TP_printk("dev=%d:%d ino=0x%lx errseq=0x%x",
77 MAJOR(__entry
->s_dev
), MINOR(__entry
->s_dev
),
78 __entry
->i_ino
, __entry
->errseq
)
81 TRACE_EVENT(file_check_and_advance_wb_err
,
82 TP_PROTO(struct file
*file
, errseq_t old
),
87 __field(struct file
*, file
);
88 __field(unsigned long, i_ino
)
90 __field(errseq_t
, old
)
91 __field(errseq_t
, new)
96 __entry
->i_ino
= file
->f_mapping
->host
->i_ino
;
97 if (file
->f_mapping
->host
->i_sb
)
99 file
->f_mapping
->host
->i_sb
->s_dev
;
102 file
->f_mapping
->host
->i_rdev
;
104 __entry
->new = file
->f_wb_err
;
107 TP_printk("file=%p dev=%d:%d ino=0x%lx old=0x%x new=0x%x",
108 __entry
->file
, MAJOR(__entry
->s_dev
),
109 MINOR(__entry
->s_dev
), __entry
->i_ino
, __entry
->old
,
112 #endif /* _TRACE_FILEMAP_H */
114 /* This part must be outside protection */
115 #include <trace/define_trace.h>