File Index
Files and directories
Sign in
FILE

get_func_ip_uprobe_test.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/get_func_ip_uprobe_test.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
 8unsigned long uprobe_trigger_body;
 9
10__u64 test1_result = 0;
11SEC("uprobe//proc/self/exe:uprobe_trigger_body+1")
12int BPF_UPROBE(test1)
13{
14	__u64 addr = bpf_get_func_ip(ctx);
15
16	test1_result = (const void *) addr == (const void *) uprobe_trigger_body + 1;
17	return 0;
18}
~/ Read-only file preview.