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