xref: /linux/tools/testing/selftests/bpf/progs/uprobe_syscall.c (revision c94cd9508b1335b949fd13ebd269313c65492df0)
1 // SPDX-License-Identifier: GPL-2.0
2 #include "vmlinux.h"
3 #include <bpf/bpf_helpers.h>
4 #include <string.h>
5 
6 struct pt_regs regs;
7 
8 char _license[] SEC("license") = "GPL";
9 
10 SEC("uretprobe//proc/self/exe:uretprobe_regs_trigger")
11 int uretprobe(struct pt_regs *ctx)
12 {
13 	__builtin_memcpy(&regs, ctx, sizeof(regs));
14 	return 0;
15 }
16