我有一个附加到
page_fault_user
跟踪点的 eBPF 函数。
struct trace_event_raw_x86_exceptions {
struct trace_entry ent;
long unsigned int address;
long unsigned int ip;
long unsigned int error_code;
char __data[0];
};
SEC("tp/exceptions/page_fault_user")
int handle_tp(trace_event_raw_x86_exceptions *ctx)
{
bpf_printk("page-fault-user at %p.\n", ctx->address);
return 0;
}
struct trace_event_raw_x86_exceptions
根据/sys/kernel/debug/tracing/events/exceptions/page_fault_user/format
的内容定义。但是,我无法获得正确的故障地址表ctx->address
。
我已确认 eBPF 函数
handle_tp
已成功附加到 page_fault_user
跟踪点,但 bpf_printk
打印了错误的故障地址。