File Index
Files and directories
Sign in
FILE

freplace_unreliable_prog.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/freplace_unreliable_prog.c C
 1// SPDX-License-Identifier: GPL-2.0
 2// Copyright (c) 2020 Facebook
 3
 4#include "vmlinux.h"
 5#include <bpf/bpf_helpers.h>
 6#include <bpf/bpf_tracing.h>
 7
 8SEC("freplace/btf_unreliable_kprobe")
 9/* context type is what BPF verifier expects for kprobe context, but target
10 * program has `stuct whatever *ctx` argument, so freplace operation will be
11 * rejected with the following message:
12 *
13 * arg0 replace_btf_unreliable_kprobe(struct pt_regs *) doesn't match btf_unreliable_kprobe(struct whatever *)
14 */
15int replace_btf_unreliable_kprobe(bpf_user_pt_regs_t *ctx)
16{
17	return 0;
18}
19
20char _license[] SEC("license") = "GPL";
~/ Read-only file preview.