0001
0002
0003
0004
0005
0006
0007
0008 #include "vmlinux.h"
0009
0010 #include <bpf/bpf_helpers.h>
0011
0012 int out__existing_typed = -1;
0013 __u64 out__existing_typeless = -1;
0014
0015 __u64 out__non_existent_typeless = -1;
0016 __u64 out__non_existent_typed = -1;
0017
0018
0019
0020
0021 extern const struct rq runqueues __ksym __weak;
0022 extern const void bpf_prog_active __ksym __weak;
0023
0024
0025
0026
0027
0028 extern const void bpf_link_fops1 __ksym __weak;
0029
0030
0031 extern const int bpf_link_fops2 __ksym __weak;
0032
0033 SEC("raw_tp/sys_enter")
0034 int pass_handler(const void *ctx)
0035 {
0036 struct rq *rq;
0037
0038
0039 rq = (struct rq *)bpf_per_cpu_ptr(&runqueues, 0);
0040 if (rq)
0041 out__existing_typed = rq->cpu;
0042 out__existing_typeless = (__u64)&bpf_prog_active;
0043
0044
0045 out__non_existent_typeless = (__u64)&bpf_link_fops1;
0046
0047
0048 out__non_existent_typed = (__u64)&bpf_link_fops2;
0049
0050 if (&bpf_link_fops2)
0051 out__non_existent_typed = (__u64)bpf_per_cpu_ptr(&bpf_link_fops2, 0);
0052
0053 return 0;
0054 }
0055
0056 char _license[] SEC("license") = "GPL";