2 #define TRACE_SYSTEM fs_dax
4 #if !defined(_TRACE_FS_DAX_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_FS_DAX_H
7 #include <linux/tracepoint.h>
9 DECLARE_EVENT_CLASS(dax_pmd_fault_class
,
10 TP_PROTO(struct inode
*inode
, struct vm_fault
*vmf
,
11 pgoff_t max_pgoff
, int result
),
12 TP_ARGS(inode
, vmf
, max_pgoff
, result
),
14 __field(unsigned long, ino
)
15 __field(unsigned long, vm_start
)
16 __field(unsigned long, vm_end
)
17 __field(unsigned long, vm_flags
)
18 __field(unsigned long, address
)
19 __field(pgoff_t
, pgoff
)
20 __field(pgoff_t
, max_pgoff
)
22 __field(unsigned int, flags
)
26 __entry
->dev
= inode
->i_sb
->s_dev
;
27 __entry
->ino
= inode
->i_ino
;
28 __entry
->vm_start
= vmf
->vma
->vm_start
;
29 __entry
->vm_end
= vmf
->vma
->vm_end
;
30 __entry
->vm_flags
= vmf
->vma
->vm_flags
;
31 __entry
->address
= vmf
->address
;
32 __entry
->flags
= vmf
->flags
;
33 __entry
->pgoff
= vmf
->pgoff
;
34 __entry
->max_pgoff
= max_pgoff
;
35 __entry
->result
= result
;
37 TP_printk("dev %d:%d ino %#lx %s %s address %#lx vm_start "
38 "%#lx vm_end %#lx pgoff %#lx max_pgoff %#lx %s",
42 __entry
->vm_flags
& VM_SHARED
? "shared" : "private",
43 __print_flags(__entry
->flags
, "|", FAULT_FLAG_TRACE
),
49 __print_flags(__entry
->result
, "|", VM_FAULT_RESULT_TRACE
)
53 #define DEFINE_PMD_FAULT_EVENT(name) \
54 DEFINE_EVENT(dax_pmd_fault_class, name, \
55 TP_PROTO(struct inode *inode, struct vm_fault *vmf, \
56 pgoff_t max_pgoff, int result), \
57 TP_ARGS(inode, vmf, max_pgoff, result))
59 DEFINE_PMD_FAULT_EVENT(dax_pmd_fault
);
60 DEFINE_PMD_FAULT_EVENT(dax_pmd_fault_done
);
62 DECLARE_EVENT_CLASS(dax_pmd_load_hole_class
,
63 TP_PROTO(struct inode
*inode
, struct vm_fault
*vmf
,
64 struct page
*zero_page
,
66 TP_ARGS(inode
, vmf
, zero_page
, radix_entry
),
68 __field(unsigned long, ino
)
69 __field(unsigned long, vm_flags
)
70 __field(unsigned long, address
)
71 __field(struct page
*, zero_page
)
72 __field(void *, radix_entry
)
76 __entry
->dev
= inode
->i_sb
->s_dev
;
77 __entry
->ino
= inode
->i_ino
;
78 __entry
->vm_flags
= vmf
->vma
->vm_flags
;
79 __entry
->address
= vmf
->address
;
80 __entry
->zero_page
= zero_page
;
81 __entry
->radix_entry
= radix_entry
;
83 TP_printk("dev %d:%d ino %#lx %s address %#lx zero_page %p "
88 __entry
->vm_flags
& VM_SHARED
? "shared" : "private",
91 (unsigned long)__entry
->radix_entry
95 #define DEFINE_PMD_LOAD_HOLE_EVENT(name) \
96 DEFINE_EVENT(dax_pmd_load_hole_class, name, \
97 TP_PROTO(struct inode *inode, struct vm_fault *vmf, \
98 struct page *zero_page, void *radix_entry), \
99 TP_ARGS(inode, vmf, zero_page, radix_entry))
101 DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole
);
102 DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole_fallback
);
104 DECLARE_EVENT_CLASS(dax_pmd_insert_mapping_class
,
105 TP_PROTO(struct inode
*inode
, struct vm_fault
*vmf
,
106 long length
, pfn_t pfn
, void *radix_entry
),
107 TP_ARGS(inode
, vmf
, length
, pfn
, radix_entry
),
109 __field(unsigned long, ino
)
110 __field(unsigned long, vm_flags
)
111 __field(unsigned long, address
)
112 __field(long, length
)
113 __field(u64
, pfn_val
)
114 __field(void *, radix_entry
)
119 __entry
->dev
= inode
->i_sb
->s_dev
;
120 __entry
->ino
= inode
->i_ino
;
121 __entry
->vm_flags
= vmf
->vma
->vm_flags
;
122 __entry
->address
= vmf
->address
;
123 __entry
->write
= vmf
->flags
& FAULT_FLAG_WRITE
;
124 __entry
->length
= length
;
125 __entry
->pfn_val
= pfn
.val
;
126 __entry
->radix_entry
= radix_entry
;
128 TP_printk("dev %d:%d ino %#lx %s %s address %#lx length %#lx "
129 "pfn %#llx %s radix_entry %#lx",
133 __entry
->vm_flags
& VM_SHARED
? "shared" : "private",
134 __entry
->write
? "write" : "read",
137 __entry
->pfn_val
& ~PFN_FLAGS_MASK
,
138 __print_flags_u64(__entry
->pfn_val
& PFN_FLAGS_MASK
, "|",
140 (unsigned long)__entry
->radix_entry
144 #define DEFINE_PMD_INSERT_MAPPING_EVENT(name) \
145 DEFINE_EVENT(dax_pmd_insert_mapping_class, name, \
146 TP_PROTO(struct inode *inode, struct vm_fault *vmf, \
147 long length, pfn_t pfn, void *radix_entry), \
148 TP_ARGS(inode, vmf, length, pfn, radix_entry))
150 DEFINE_PMD_INSERT_MAPPING_EVENT(dax_pmd_insert_mapping
);
151 DEFINE_PMD_INSERT_MAPPING_EVENT(dax_pmd_insert_mapping_fallback
);
153 DECLARE_EVENT_CLASS(dax_pte_fault_class
,
154 TP_PROTO(struct inode
*inode
, struct vm_fault
*vmf
, int result
),
155 TP_ARGS(inode
, vmf
, result
),
157 __field(unsigned long, ino
)
158 __field(unsigned long, vm_flags
)
159 __field(unsigned long, address
)
160 __field(pgoff_t
, pgoff
)
162 __field(unsigned int, flags
)
166 __entry
->dev
= inode
->i_sb
->s_dev
;
167 __entry
->ino
= inode
->i_ino
;
168 __entry
->vm_flags
= vmf
->vma
->vm_flags
;
169 __entry
->address
= vmf
->address
;
170 __entry
->flags
= vmf
->flags
;
171 __entry
->pgoff
= vmf
->pgoff
;
172 __entry
->result
= result
;
174 TP_printk("dev %d:%d ino %#lx %s %s address %#lx pgoff %#lx %s",
178 __entry
->vm_flags
& VM_SHARED
? "shared" : "private",
179 __print_flags(__entry
->flags
, "|", FAULT_FLAG_TRACE
),
182 __print_flags(__entry
->result
, "|", VM_FAULT_RESULT_TRACE
)
186 #define DEFINE_PTE_FAULT_EVENT(name) \
187 DEFINE_EVENT(dax_pte_fault_class, name, \
188 TP_PROTO(struct inode *inode, struct vm_fault *vmf, int result), \
189 TP_ARGS(inode, vmf, result))
191 DEFINE_PTE_FAULT_EVENT(dax_pte_fault
);
192 DEFINE_PTE_FAULT_EVENT(dax_pte_fault_done
);
193 DEFINE_PTE_FAULT_EVENT(dax_pfn_mkwrite_no_entry
);
194 DEFINE_PTE_FAULT_EVENT(dax_pfn_mkwrite
);
195 DEFINE_PTE_FAULT_EVENT(dax_load_hole
);
197 TRACE_EVENT(dax_insert_mapping
,
198 TP_PROTO(struct inode
*inode
, struct vm_fault
*vmf
, void *radix_entry
),
199 TP_ARGS(inode
, vmf
, radix_entry
),
201 __field(unsigned long, ino
)
202 __field(unsigned long, vm_flags
)
203 __field(unsigned long, address
)
204 __field(void *, radix_entry
)
209 __entry
->dev
= inode
->i_sb
->s_dev
;
210 __entry
->ino
= inode
->i_ino
;
211 __entry
->vm_flags
= vmf
->vma
->vm_flags
;
212 __entry
->address
= vmf
->address
;
213 __entry
->write
= vmf
->flags
& FAULT_FLAG_WRITE
;
214 __entry
->radix_entry
= radix_entry
;
216 TP_printk("dev %d:%d ino %#lx %s %s address %#lx radix_entry %#lx",
220 __entry
->vm_flags
& VM_SHARED
? "shared" : "private",
221 __entry
->write
? "write" : "read",
223 (unsigned long)__entry
->radix_entry
227 DECLARE_EVENT_CLASS(dax_writeback_range_class
,
228 TP_PROTO(struct inode
*inode
, pgoff_t start_index
, pgoff_t end_index
),
229 TP_ARGS(inode
, start_index
, end_index
),
231 __field(unsigned long, ino
)
232 __field(pgoff_t
, start_index
)
233 __field(pgoff_t
, end_index
)
237 __entry
->dev
= inode
->i_sb
->s_dev
;
238 __entry
->ino
= inode
->i_ino
;
239 __entry
->start_index
= start_index
;
240 __entry
->end_index
= end_index
;
242 TP_printk("dev %d:%d ino %#lx pgoff %#lx-%#lx",
246 __entry
->start_index
,
251 #define DEFINE_WRITEBACK_RANGE_EVENT(name) \
252 DEFINE_EVENT(dax_writeback_range_class, name, \
253 TP_PROTO(struct inode *inode, pgoff_t start_index, pgoff_t end_index),\
254 TP_ARGS(inode, start_index, end_index))
256 DEFINE_WRITEBACK_RANGE_EVENT(dax_writeback_range
);
257 DEFINE_WRITEBACK_RANGE_EVENT(dax_writeback_range_done
);
259 TRACE_EVENT(dax_writeback_one
,
260 TP_PROTO(struct inode
*inode
, pgoff_t pgoff
, pgoff_t pglen
),
261 TP_ARGS(inode
, pgoff
, pglen
),
263 __field(unsigned long, ino
)
264 __field(pgoff_t
, pgoff
)
265 __field(pgoff_t
, pglen
)
269 __entry
->dev
= inode
->i_sb
->s_dev
;
270 __entry
->ino
= inode
->i_ino
;
271 __entry
->pgoff
= pgoff
;
272 __entry
->pglen
= pglen
;
274 TP_printk("dev %d:%d ino %#lx pgoff %#lx pglen %#lx",
283 #endif /* _TRACE_FS_DAX_H */
285 /* This part must be outside protection */
286 #include <trace/define_trace.h>