Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Exception: Failed to compile BPF module #49

Open
Linuxuser4 opened this issue Apr 18, 2018 · 3 comments
Open

Exception: Failed to compile BPF module #49

Linuxuser4 opened this issue Apr 18, 2018 · 3 comments

Comments

@Linuxuser4
Copy link

Hi,
I am trying to use bpfd with host as ubuntu (4.4.0-116) and target as android(arm64 linux version 4.4). For any utility I run, I get the error "Exception: Failed to compile BPF module "
More detailed log is below. Am I missing anything very obvious? autoconf.h will not be present as part of kernel source since all build generated files will be in 'out' directory created by android build environment. If I point to the generated 'out' directory, 'filetop' will complain that './include/linux/kconfig.h' file not found which is not in 'out' directory, but in the main kernel sources. How do I give path of both 'out' folder and kernel folder sources? Do I have to manually merge these and try out?

(bcc) root@hostname:$ filetop
In file included from :1:
././include/linux/kconfig.h:4:10: fatal error: 'generated/autoconf.h' file not found
#include <generated/autoconf.h>
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Traceback (most recent call last):
File "/usr/local/bpfd-install/share/bcc/tools/filetop", line 156, in
b = BPF(text=bpf_text)
File "/usr/local/bpfd-install/lib/python2.7/dist-packages/bcc/init.py", line 321, in init
raise Exception("Failed to compile BPF module %s" % src_file)
Exception: Failed to compile BPF module
(bcc) root@hostname:
$

@joelagnel
Copy link
Owner

joelagnel commented Apr 18, 2018 via email

@Linuxuser4
Copy link
Author

Thanks for offering to look into this.
In the meantime, I thought of building the android kernel out of the android build environment to reduce dependency on android. I was able to build, albeit with large number of minor hacks.

When I now try filetop, I see "NameError: global name '_invalidate_map_cache' is not defined".
Last few statements from my log are:

./arch/arm64/include/asm/uaccess.h:341:34: note: expanded from macro '__put_user_err'
__put_user_asm("str", "sttr", "%", __pu_val, (ptr),
^
21 warnings generated.
Tracing... Output every 1 secs. Hit Ctrl-C to end

11:16:04 loadavg: 0.43 0.29 0.21 1/775 8169

PID COMM D MAJ MIN DISK I/O Kbytes AVGms
Traceback (most recent call last):
File "/usr/local/bpfd-install/share/bcc/tools/biotop", line 222, in
counts.clear()
File "/usr/local/bpfd-install/lib/python2.7/dist-packages/bcc/table.py", line 270, in clear
self.libremote.bpf_clear_map(self.map_fd, klen)
File "/usr/local/bpfd-install/lib/python2.7/dist-packages/bcc/remote/libremote.py", line 203, in bpf_clear_map
_invalidate_map_cache(map_fd)
NameError: global name '_invalidate_map_cache' is not defined
(bcc) root@hostname:~$

@joelagnel
Copy link
Owner

joelagnel commented Apr 19, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants