Ross Zwisler | 282a8e0 | 2017-02-22 15:39:50 -0800 | [diff] [blame^] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM fs_dax |
| 3 | |
| 4 | #if !defined(_TRACE_FS_DAX_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_FS_DAX_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | |
| 9 | DECLARE_EVENT_CLASS(dax_pmd_fault_class, |
| 10 | TP_PROTO(struct inode *inode, struct vm_area_struct *vma, |
| 11 | unsigned long address, unsigned int flags, pgoff_t pgoff, |
| 12 | pgoff_t max_pgoff, int result), |
| 13 | TP_ARGS(inode, vma, address, flags, pgoff, max_pgoff, result), |
| 14 | TP_STRUCT__entry( |
| 15 | __field(unsigned long, ino) |
| 16 | __field(unsigned long, vm_start) |
| 17 | __field(unsigned long, vm_end) |
| 18 | __field(unsigned long, vm_flags) |
| 19 | __field(unsigned long, address) |
| 20 | __field(pgoff_t, pgoff) |
| 21 | __field(pgoff_t, max_pgoff) |
| 22 | __field(dev_t, dev) |
| 23 | __field(unsigned int, flags) |
| 24 | __field(int, result) |
| 25 | ), |
| 26 | TP_fast_assign( |
| 27 | __entry->dev = inode->i_sb->s_dev; |
| 28 | __entry->ino = inode->i_ino; |
| 29 | __entry->vm_start = vma->vm_start; |
| 30 | __entry->vm_end = vma->vm_end; |
| 31 | __entry->vm_flags = vma->vm_flags; |
| 32 | __entry->address = address; |
| 33 | __entry->flags = flags; |
| 34 | __entry->pgoff = pgoff; |
| 35 | __entry->max_pgoff = max_pgoff; |
| 36 | __entry->result = result; |
| 37 | ), |
| 38 | TP_printk("dev %d:%d ino %#lx %s %s address %#lx vm_start " |
| 39 | "%#lx vm_end %#lx pgoff %#lx max_pgoff %#lx %s", |
| 40 | MAJOR(__entry->dev), |
| 41 | MINOR(__entry->dev), |
| 42 | __entry->ino, |
| 43 | __entry->vm_flags & VM_SHARED ? "shared" : "private", |
| 44 | __print_flags(__entry->flags, "|", FAULT_FLAG_TRACE), |
| 45 | __entry->address, |
| 46 | __entry->vm_start, |
| 47 | __entry->vm_end, |
| 48 | __entry->pgoff, |
| 49 | __entry->max_pgoff, |
| 50 | __print_flags(__entry->result, "|", VM_FAULT_RESULT_TRACE) |
| 51 | ) |
| 52 | ) |
| 53 | |
| 54 | #define DEFINE_PMD_FAULT_EVENT(name) \ |
| 55 | DEFINE_EVENT(dax_pmd_fault_class, name, \ |
| 56 | TP_PROTO(struct inode *inode, struct vm_area_struct *vma, \ |
| 57 | unsigned long address, unsigned int flags, pgoff_t pgoff, \ |
| 58 | pgoff_t max_pgoff, int result), \ |
| 59 | TP_ARGS(inode, vma, address, flags, pgoff, max_pgoff, result)) |
| 60 | |
| 61 | DEFINE_PMD_FAULT_EVENT(dax_pmd_fault); |
| 62 | DEFINE_PMD_FAULT_EVENT(dax_pmd_fault_done); |
| 63 | |
| 64 | |
| 65 | #endif /* _TRACE_FS_DAX_H */ |
| 66 | |
| 67 | /* This part must be outside protection */ |
| 68 | #include <trace/define_trace.h> |