Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何获取Linux内核的bpf_helpers.h头文件?_Linux_Linux Kernel_Header Files_Bpf_Ebpf - Fatal编程技术网

如何获取Linux内核的bpf_helpers.h头文件?

如何获取Linux内核的bpf_helpers.h头文件?,linux,linux-kernel,header-files,bpf,ebpf,Linux,Linux Kernel,Header Files,Bpf,Ebpf,我正在Ubuntu机器上开发一个eBPF程序: $ uname -a Linux ubuntu-bionic 4.18.0-16-generic #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux 要做到这一点,我需要bpf.h来获得许多定义以及帮助函数定义。我安装了一个新内核,其标题如下: apt-get update -y apt-get install -y linux-im

我正在Ubuntu机器上开发一个eBPF程序:

$ uname -a
Linux ubuntu-bionic 4.18.0-16-generic #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
要做到这一点,我需要
bpf.h
来获得许多定义以及帮助函数定义。我安装了一个新内核,其标题如下:

apt-get update -y
apt-get install -y linux-image-4.18.0-16-generic linux-headers-4.18.0-16-generic
标题包括
bpf.h

$ find /usr/src/linux-headers-4.18.0-16 -name bpf.h
/usr/src/linux-headers-4.18.0-16/include/uapi/linux/bpf.h
/usr/src/linux-headers-4.18.0-16/include/linux/bpf.h
$ find /usr/src/linux-headers-4.18.0-16 -name bpf_helpers.h
但不是bpf\U助手。h:

$ find /usr/src/linux-headers-4.18.0-16 -name bpf.h
/usr/src/linux-headers-4.18.0-16/include/uapi/linux/bpf.h
/usr/src/linux-headers-4.18.0-16/include/linux/bpf.h
$ find /usr/src/linux-headers-4.18.0-16 -name bpf_helpers.h
我如何为我的内核获取这个文件,为什么它不包含在发行版头中


我可以签出特定版本的Linux内核或从中获取文件,但发行版可能会对上游进行更改,这让我感到不舒服。

bpf\u helpers.h。正如Agg3L在评论中所建议的,您可以从.< /p>中复制它。您是否考虑过在Linux源Ubuntu的包中,即您的目标OS内核源包?