bcc icon indicating copy to clipboard operation
bcc copied to clipboard

arm64: 'asm/types.h' file not found

Open NirGeller18 opened this issue 3 years ago • 7 comments

Hi there,

I'm trying to use bcc tools 0.17.0-ad5b82a5 on a arm64. Python version is 3.9, Kernel version is 5.10.109, and I have the kernel headers installed on the file system.

When trying to use any tool, I'm getting the following error:

./tcptop

In file included from :2: In file included from /virtual/include/bcc/bpf.h:12: In file included from include/linux/types.h:6: include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found #include <asm/types.h> ^~~~~~~~~~~~~ 1 error generated. Traceback (most recent call last): File "/usr/share/bcc/tools/./tcptop", line 225, in b = BPF(text=bpf_text) File "/usr/lib/python3.9/site-packages/bcc/init.py", line 364, in init raise Exception("Failed to compile BPF module %s" % (src_file or "")) Exception: Failed to compile BPF module

Referring to issue #3731 I tried setting the environment variable BCC_KERNEL_SOURCE, but the result is the same. Anyway, this issue is relevant to x86-64, my case is arm64.

Can you advise?

Thanks,

Nir.

NirGeller18 avatar Sep 27 '22 14:09 NirGeller18

Hi,

any comment would be appreciated.

NirGeller18 avatar Oct 03 '22 13:10 NirGeller18

Have you tried all advices in #3731 ? I don't have a arm64 device to reproduce this.

chenhengqi avatar Oct 04 '22 12:10 chenhengqi

Hi,

I tried all kinds of symbolic links like /usr/include/aarch64-linux-gnu/asm -> /usr/include/asm

I also tried setting the environment variable BCC_KERNEL_SOURCE pointing it to the kernel headers on my file system, /lib/modules/5.10.109-tq+g7545a39531f6-tq/build/

the result is always the same.

If possible, I'm looking for an elegant solution that doesn't involve editing the linux kernel headers or copying files from one directory to another.

Thanks,

Nir.

NirGeller18 avatar Oct 06 '22 07:10 NirGeller18

Does anybody have experience with using bcc tools on arm64?

NirGeller18 avatar Oct 13 '22 06:10 NirGeller18

I had met the same error before, but link /usr/include/asm to /usr/include$(uname -m)-linux-gnu/asm solved this. Maybe you need to check if asm/types.h exists or search on the system to find one. Just FYI.

woodpenker avatar Nov 14 '22 11:11 woodpenker

I met the same problem when I using bcc tools on arm64. When I connect debian with ssh on CentOS7(WSL), I met the same problem eb85dfe5494df15b1d24c7c56da2041 But It won't happened on Ubuntu20.04(WSL) image

Gift1a avatar Nov 20 '23 08:11 Gift1a