| 1 | #if !defined(LTTNG_TRACE_EXCEPTIONS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 2 | #define LTTNG_TRACE_EXCEPTIONS_H |
| 3 | |
| 4 | #include <probes/lttng-tracepoint-event.h> |
| 5 | #include <linux/version.h> |
| 6 | |
| 7 | #undef TRACE_SYSTEM |
| 8 | #define TRACE_SYSTEM x86_exceptions |
| 9 | |
| 10 | LTTNG_TRACEPOINT_EVENT_CLASS(x86_exceptions_class, |
| 11 | |
| 12 | TP_PROTO(unsigned long address, struct pt_regs *regs, |
| 13 | unsigned long error_code), |
| 14 | |
| 15 | TP_ARGS(address, regs, error_code), |
| 16 | |
| 17 | TP_FIELDS( |
| 18 | ctf_integer_hex(unsigned long, address, address) |
| 19 | ctf_integer_hex(unsigned long, ip, regs->ip) |
| 20 | /* |
| 21 | * Note: we cast error_code from unsigned long |
| 22 | * to unsigned char to save space in the trace. |
| 23 | * Currently, only 5 low bits are used. Should be made |
| 24 | * larger if error codes are added to the kernel. |
| 25 | */ |
| 26 | ctf_integer_hex(unsigned char, error_code, error_code) |
| 27 | ) |
| 28 | ) |
| 29 | |
| 30 | #define LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(name, map) \ |
| 31 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_exceptions_class, \ |
| 32 | name, \ |
| 33 | map, \ |
| 34 | TP_PROTO(unsigned long address, struct pt_regs *regs, \ |
| 35 | unsigned long error_code), \ |
| 36 | TP_ARGS(address, regs, error_code) \ |
| 37 | ) |
| 38 | |
| 39 | LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(page_fault_user, |
| 40 | x86_exceptions_page_fault_user) |
| 41 | LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(page_fault_kernel, |
| 42 | x86_exceptions_page_fault_kernel) |
| 43 | |
| 44 | #endif /* LTTNG_TRACE_EXCEPTIONS_H */ |
| 45 | |
| 46 | #undef TRACE_INCLUDE_PATH |
| 47 | #define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86 |
| 48 | #undef TRACE_INCLUDE_FILE |
| 49 | #define TRACE_INCLUDE_FILE exceptions |
| 50 | |
| 51 | /* This part must be outside protection */ |
| 52 | #include <probes/define_trace.h> |