1 #undef TRACE_SYSTEM 2 #define TRACE_SYSTEM exceptions 3 4 #if !defined(_TRACE_PAGE_FAULT_H) || defined(TRACE_HEADER_MULTI_READ) 5 #define _TRACE_PAGE_FAULT_H 6 7 #include <linux/tracepoint.h> 8 #include <asm/trace/common.h> 9 10 extern int trace_pagefault_reg(void); 11 extern void trace_pagefault_unreg(void); 12 13 DECLARE_EVENT_CLASS(x86_exceptions, 14 15 TP_PROTO(unsigned long address, struct pt_regs *regs, 16 unsigned long error_code), 17 18 TP_ARGS(address, regs, error_code), 19 20 TP_STRUCT__entry( 21 __field( unsigned long, address ) 22 __field( unsigned long, ip ) 23 __field( unsigned long, error_code ) 24 ), 25 26 TP_fast_assign( 27 __entry->address = address; 28 __entry->ip = regs->ip; 29 __entry->error_code = error_code; 30 ), 31 32 TP_printk("address=%pf ip=%pf error_code=0x%lx", 33 (void *)__entry->address, (void *)__entry->ip, 34 __entry->error_code) ); 35 36 #define DEFINE_PAGE_FAULT_EVENT(name) \ 37 DEFINE_EVENT_FN(x86_exceptions, name, \ 38 TP_PROTO(unsigned long address, struct pt_regs *regs, \ 39 unsigned long error_code), \ 40 TP_ARGS(address, regs, error_code), \ 41 trace_pagefault_reg, trace_pagefault_unreg); 42 43 DEFINE_PAGE_FAULT_EVENT(page_fault_user); 44 DEFINE_PAGE_FAULT_EVENT(page_fault_kernel); 45 46 #undef TRACE_INCLUDE_PATH 47 #define TRACE_INCLUDE_PATH . 48 #define TRACE_INCLUDE_FILE exceptions 49 #endif /* _TRACE_PAGE_FAULT_H */ 50 51 /* This part must be outside protection */ 52 #include <trace/define_trace.h> 53