Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Copyright (c) 2019 Facebook */
0003 
0004 #include <stdbool.h>
0005 #include <linux/bpf.h>
0006 #include <bpf/bpf_helpers.h>
0007 
0008 __u64 out__bpf_link_fops = -1;
0009 __u64 out__bpf_link_fops1 = -1;
0010 __u64 out__btf_size = -1;
0011 __u64 out__per_cpu_start = -1;
0012 
0013 extern const void bpf_link_fops __ksym;
0014 extern const void __start_BTF __ksym;
0015 extern const void __stop_BTF __ksym;
0016 extern const void __per_cpu_start __ksym;
0017 /* non-existing symbol, weak, default to zero */
0018 extern const void bpf_link_fops1 __ksym __weak;
0019 
0020 SEC("raw_tp/sys_enter")
0021 int handler(const void *ctx)
0022 {
0023     out__bpf_link_fops = (__u64)&bpf_link_fops;
0024     out__btf_size = (__u64)(&__stop_BTF - &__start_BTF);
0025     out__per_cpu_start = (__u64)&__per_cpu_start;
0026 
0027     out__bpf_link_fops1 = (__u64)&bpf_link_fops1;
0028 
0029     return 0;
0030 }
0031 
0032 char _license[] SEC("license") = "GPL";