Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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__u64 test1_entry_result = 0;
9__u64 test1_exit_result = 0;
10
11SEC("fsession/bpf_fentry_test1")
12int BPF_PROG(test1, int a)
13{
14 __u64 addr = bpf_get_func_ip(ctx);
15
16 if (bpf_session_is_return(ctx))
17 test1_exit_result = (const void *) addr == &bpf_fentry_test1;
18 else
19 test1_entry_result = (const void *) addr == &bpf_fentry_test1;
20 return 0;
21}