问题概述: bcc的包没有和最新的内核同步发布,导致bcc功能不可用 repo里面已经发布了kernel-6.6.71-3的内核。但是repo里的bcc还是和旧的kernel-6.6.25-2.2内核配套。 验证步骤: [root@iZbp12gvtfevdipl8om4bqZ tools]# ./cachestat 1 2 modprobe: FATAL: Module kheaders not found in directory /lib/modules/6.6.25-2.2.an23.aarch64 Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m (module) or installing the kernel development package for your running kernel version. chdir(/lib/modules/6.6.25-2.2.an23.aarch64/build): No such file or directory Traceback (most recent call last): File "/usr/share/bcc/tools/./cachestat", line 120, in <module> b = BPF(text=bpf_text) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/bcc/__init__.py", line 479, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> [root@iZbp12gvtfevdipl8om4bqZ tools]# rpm -qa | grep kernel kernel-6.6.25-2.2.an23.aarch64 kernel-tools-libs-6.6.71-3.an23.aarch64 kernel-tools-6.6.71-3.an23.aarch64 kernel-headers-6.6.71-3.an23.aarch64 kernel-6.6.71-3.an23.aarch64 kernel-devel-6.6.71-3.an23.aarch64 [root@iZbp12gvtfevdipl8om4bqZ tools]# ./vfscount 1 modprobe: FATAL: Module kheaders not found in directory /lib/modules/6.6.25-2.2.an23.aarch64 Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m (module) or installing the kernel development package for your running kernel version. chdir(/lib/modules/6.6.25-2.2.an23.aarch64/build): No such file or directory Traceback (most recent call last): File "/usr/share/bcc/tools/./vfscount", line 31, in <module> b = BPF(text=""" ^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/bcc/__init__.py", line 479, in __init__ raise Exception("Failed to compile BPF module %s" % (src_file or "<text>")) Exception: Failed to compile BPF module <text> [root@iZbp12gvtfevdipl8om4bqZ tools]# ldd ./vfscount not a dynamic executable [root@iZbp12gvtfevdipl8om4bqZ tools]# file ./vfscount ./vfscount: Python script, ASCII text executable [root@iZbp12gvtfevdipl8om4bqZ tools]# file ./cachestat ./cachestat: Python script, ASCII text executable [root@iZbp12gvtfevdipl8om4bqZ tools]# vim ./vfscount [root@iZbp12gvtfevdipl8om4bqZ tools]# rpm -qa | grep bcc bcc-tools-0.30.0-1.an23.aarch64 bcc-0.30.0-1.an23.aarch64 python3-bcc-0.30.0-1.an23.noarch 环境: [root@iZbp13yv3gjues4ly59lkkZ ~]# cat /etc/os-release NAME="Anolis OS" VERSION="23.2" ID="anolis" VERSION_ID="23.2" PLATFORM_ID="platform:an23" PRETTY_NAME="Anolis OS 23.2" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" BUG_REPORT_URL="https://bugzilla.openanolis.cn/" [root@iZbp13yv3gjues4ly59lkkZ ~]# arch aarch64