Laurent Dufour | 736ae8b | 2018-04-17 16:33:25 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #undef TRACE_SYSTEM |
| 3 | #undef TRACE_INCLUDE_PATH |
| 4 | #define TRACE_SYSTEM pagefault |
| 5 | |
| 6 | #if !defined(_TRACE_PAGEFAULT_H) || defined(TRACE_HEADER_MULTI_READ) |
| 7 | #define _TRACE_PAGEFAULT_H |
| 8 | |
| 9 | #include <linux/tracepoint.h> |
| 10 | #include <linux/mm.h> |
| 11 | |
| 12 | DECLARE_EVENT_CLASS(spf, |
| 13 | |
| 14 | TP_PROTO(unsigned long caller, |
| 15 | struct vm_area_struct *vma, unsigned long address), |
| 16 | |
| 17 | TP_ARGS(caller, vma, address), |
| 18 | |
| 19 | TP_STRUCT__entry( |
| 20 | __field(unsigned long, caller) |
| 21 | __field(unsigned long, vm_start) |
| 22 | __field(unsigned long, vm_end) |
| 23 | __field(unsigned long, address) |
| 24 | ), |
| 25 | |
| 26 | TP_fast_assign( |
| 27 | __entry->caller = caller; |
| 28 | __entry->vm_start = vma->vm_start; |
| 29 | __entry->vm_end = vma->vm_end; |
| 30 | __entry->address = address; |
| 31 | ), |
| 32 | |
| 33 | TP_printk("ip:%lx vma:%lx-%lx address:%lx", |
| 34 | __entry->caller, __entry->vm_start, __entry->vm_end, |
| 35 | __entry->address) |
| 36 | ); |
| 37 | |
| 38 | DEFINE_EVENT(spf, spf_pte_lock, |
| 39 | |
| 40 | TP_PROTO(unsigned long caller, |
| 41 | struct vm_area_struct *vma, unsigned long address), |
| 42 | |
| 43 | TP_ARGS(caller, vma, address) |
| 44 | ); |
| 45 | |
| 46 | DEFINE_EVENT(spf, spf_vma_changed, |
| 47 | |
| 48 | TP_PROTO(unsigned long caller, |
| 49 | struct vm_area_struct *vma, unsigned long address), |
| 50 | |
| 51 | TP_ARGS(caller, vma, address) |
| 52 | ); |
| 53 | |
| 54 | DEFINE_EVENT(spf, spf_vma_noanon, |
| 55 | |
| 56 | TP_PROTO(unsigned long caller, |
| 57 | struct vm_area_struct *vma, unsigned long address), |
| 58 | |
| 59 | TP_ARGS(caller, vma, address) |
| 60 | ); |
| 61 | |
| 62 | DEFINE_EVENT(spf, spf_vma_notsup, |
| 63 | |
| 64 | TP_PROTO(unsigned long caller, |
| 65 | struct vm_area_struct *vma, unsigned long address), |
| 66 | |
| 67 | TP_ARGS(caller, vma, address) |
| 68 | ); |
| 69 | |
| 70 | DEFINE_EVENT(spf, spf_vma_access, |
| 71 | |
| 72 | TP_PROTO(unsigned long caller, |
| 73 | struct vm_area_struct *vma, unsigned long address), |
| 74 | |
| 75 | TP_ARGS(caller, vma, address) |
| 76 | ); |
| 77 | |
| 78 | DEFINE_EVENT(spf, spf_pmd_changed, |
| 79 | |
| 80 | TP_PROTO(unsigned long caller, |
| 81 | struct vm_area_struct *vma, unsigned long address), |
| 82 | |
| 83 | TP_ARGS(caller, vma, address) |
| 84 | ); |
| 85 | |
| 86 | #endif /* _TRACE_PAGEFAULT_H */ |
| 87 | |
| 88 | /* This part must be outside protection */ |
| 89 | #include <trace/define_trace.h> |