/virtual/include/bcc/helpers.h:57:2: error: "CONFIG_BPF_SYSCALL is undefined...
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
hello, I am asking your help!
I am trying to install BCC on a AArcch64 machine. the OS on the machine is CentOS7.6 and the kernel is 5.14 now. the INSTALL.md suggeted as that:
******
sudo yum install -y epel-release
sudo yum update -y
sudo yum groupinstall -y "Development tools"
sudo yum install -y elfutils-libelf-devel cmake3 git bison flex ncurses-devel
sudo yum install -y luajit luajit-devel # for Lua support
curl -LO http://releases.llvm.org/7.0.1/llvm-7.0.1.src.tar.xz
curl -LO http://releases.llvm.org/7.0.1/cfe-7.0.1.src.tar.xz
tar -xf cfe-7.0.1.src.tar.xz
tar -xf llvm-7.0.1.src.tar.xz
mkdir clang-build
mkdir llvm-build
cd llvm-build
cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
-DCMAKE_BUILD_TYPE=Release ../llvm-7.0.1.src
make
sudo make install
cd ../clang-build
cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
-DCMAKE_BUILD_TYPE=Release ../cfe-7.0.1.src
make
sudo make install
cd ..
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake3 ..
make
sudo make install
******
firstly, I just follow the steps ,but it compiled failed ,then I find that it is for X86, so I change "X86" to "AArch64" as that:
*******
cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;AArch64" \
-DCMAKE_BUILD_TYPE=Release ../llvm-7.0.1.src
cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;AArch64" \
-DCMAKE_BUILD_TYPE=Release ../cfe-7.0.1.src
*******
Finally , It is compiled successfully.
but when I run the example "hello_world.py", it output the error like that:
-bash-4.2# python hello_world.py
In file included from :4:
/virtual/include/bcc/helpers.h:57:2: error: "CONFIG_BPF_SYSCALL is undefined, please check your .config or ask your Linux distro to enable this feature"
#error "CONFIG_BPF_SYSCALL is undefined, please check your .config or ask your Linux distro to enable this feature"
^
1 error generated.
Traceback (most recent call last):
File "hello_world.py", line 12, in
BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print()
File "/usr/lib/python2.7/site-packages/bcc/__init__.py", line 480, in __init__
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module
then I check the .config,the result as that:
******
-bash-4.2# cd /boot
-bash-4.2# ls
config-5.14.0-rc4+
efi
grub
grub2
initramfs-0-rescue-ce2410bd2c794e38a1205f2cf17fe500.img
initramfs-5.14.0-rc4+.img
initramfs-5.14.0-rc4+kdump.img
System.map
System.map-5.14.0-rc4+
vmlinuz
vmlinuz-0-rescue-ce2410bd2c794e38a1205f2cf17fe500
vmlinuz-5.14.0-rc4+
-bash-4.2# grep --color=auto -rns "CONFIG_BPF" ./config-5.14.0-rc4+
86:CONFIG_BPF=y
93:CONFIG_BPF_SYSCALL=y
94:CONFIG_BPF_JIT=y
95:CONFIG_BPF_JIT_ALWAYS_ON=y
96:CONFIG_BPF_JIT_DEFAULT_ON=y
97:# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
98:# CONFIG_BPF_PRELOAD is not set
99:# CONFIG_BPF_LSM is not set
1270:# CONFIG_BPFILTER is not set
1423:# CONFIG_BPF_STREAM_PARSER is not set
8863:CONFIG_BPF_EVENTS=y
8866:CONFIG_BPF_KPROBE_OVERRIDE=y
-bash-4.2# grep --color=auto -rns "BPF" ./config-5.14.0-rc4+
86:CONFIG_BPF=y
87:CONFIG_HAVE_EBPF_JIT=y
88:CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y
91:# BPF subsystem
93:CONFIG_BPF_SYSCALL=y
94:CONFIG_BPF_JIT=y
95:CONFIG_BPF_JIT_ALWAYS_ON=y
96:CONFIG_BPF_JIT_DEFAULT_ON=y
97:# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
98:# CONFIG_BPF_PRELOAD is not set
99:# CONFIG_BPF_LSM is not set
100:# end of BPF subsystem
180:CONFIG_CGROUP_BPF=y
1158:CONFIG_NETFILTER_XT_MATCH_BPF=y
1270:# CONFIG_BPFILTER is not set
1374:CONFIG_NET_CLS_BPF=y
1392:CONFIG_NET_ACT_BPF=y
1423:# CONFIG_BPF_STREAM_PARSER is not set
8863:CONFIG_BPF_EVENTS=y
8866:CONFIG_BPF_KPROBE_OVERRIDE=y
8945:CONFIG_TEST_BPF=m
******
obviously, :CONFIG_BPF_SYSCALL is set to y.
I do not know how to fix this problem and I searched the internet , but found no answers. Please hlep me ,I cannot be more grateful to you.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the build steps in INSTALL.md and the failure reported for hello_world.py, then inspect bcc/helpers.h at line 57 and compare it with the kernel configuration shown in the issue. Reproduce the example on the reported AArch64 environment and trace how the configuration is supplied to compilation. Done means hello_world.py compiles without the CONFIG_BPF_SYSCALL error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, python
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100