File Index
Files and directories
Sign in
FILE

kprobe_write_ctx.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/kprobe_write_ctx.c C
 1// SPDX-License-Identifier: GPL-2.0
 2#include "vmlinux.h"
 3#include <bpf/bpf_helpers.h>
 4#include <bpf/bpf_tracing.h>
 5
 6char _license[] SEC("license") = "GPL";
 7
 8#if defined(__TARGET_ARCH_x86)
 9SEC("kprobe")
10int kprobe_write_ctx(struct pt_regs *ctx)
11{
12	ctx->ax = 0;
13	return 0;
14}
15
16SEC("kprobe.multi")
17int kprobe_multi_write_ctx(struct pt_regs *ctx)
18{
19	ctx->ax = 0;
20	return 0;
21}
22#endif
~/ Read-only file preview.