xref: /linux/tools/testing/selftests/bpf/progs/kprobe_write_ctx.c (revision 1b881ee294b2d8929a77b0e489047765d55f0191)
1 // SPDX-License-Identifier: GPL-2.0
2 #include "vmlinux.h"
3 #include <bpf/bpf_helpers.h>
4 #include <bpf/bpf_tracing.h>
5 
6 char _license[] SEC("license") = "GPL";
7 
8 #if defined(__TARGET_ARCH_x86)
9 SEC("kprobe")
10 int kprobe_write_ctx(struct pt_regs *ctx)
11 {
12 	ctx->ax = 0;
13 	return 0;
14 }
15 #endif
16