#include #ifndef KBUILD_MODNAME #define KBUILD_MODNAME "shadow_btf_core" #endif #ifndef KBUILD_BASENAME #define KBUILD_BASENAME "shadow_btf_core" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if __has_include() #include #endif #if __has_include() #include #endif #if IS_ENABLED(CONFIG_CGROUPS) #include #endif #define BTF_KEEP(name, type) \ static type * __attribute__((used, section(".discard.btf_keep"))) \ __btf_keep_##name BTF_KEEP(pt_regs, struct pt_regs); BTF_KEEP(task_struct, struct task_struct); BTF_KEEP(mm_struct, struct mm_struct); BTF_KEEP(file, struct file); BTF_KEEP(dentry, struct dentry); BTF_KEEP(inode, struct inode); BTF_KEEP(cred, struct cred); BTF_KEEP(module, struct module); BTF_KEEP(sk_buff, struct sk_buff); BTF_KEEP(net_device, struct net_device); BTF_KEEP(netdev_queue, struct netdev_queue); BTF_KEEP(netdev_rx_queue, struct netdev_rx_queue); BTF_KEEP(sock, struct sock); BTF_KEEP(inet_sock, struct inet_sock); BTF_KEEP(inet_connection_sock, struct inet_connection_sock); BTF_KEEP(tcp_sock, struct tcp_sock); BTF_KEEP(udp_sock, struct udp_sock); BTF_KEEP(net, struct net); BTF_KEEP(dst_entry, struct dst_entry); BTF_KEEP(neighbour, struct neighbour); BTF_KEEP(xdp_buff, struct xdp_buff); BTF_KEEP(bpf_perf_event_data, struct bpf_perf_event_data); #if IS_ENABLED(CONFIG_CGROUPS) BTF_KEEP(cgroup, struct cgroup); #endif