Hi,
I want install BPF and BCC to develop debugging/monitoring applications in Nano. For example using Kprobes, etc… . I followed the installation procedure in BCC compiler collection. I also enabled below settings in kernel configuration:
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
# [optional, for tc filters]
CONFIG_NET_CLS_BPF=m
# [optional, for tc actions]
CONFIG_NET_ACT_BPF=m
CONFIG_BPF_JIT=y
# [for Linux kernel versions 4.1 through 4.6]
CONFIG_HAVE_BPF_JIT=y
# [for Linux kernel versions 4.7 and later]
CONFIG_HAVE_EBPF_JIT=y
# [optional, for kprobes]
CONFIG_BPF_EVENTS=y
# Need kernel headers through /sys/kernel/kheaders.tar.xz
CONFIG_IKHEADERS=y
But when running the sample tools provided by BCC. It cannot run it.
~/proj/javad/unitop$ sudo tcptop-bpfcc
In file included from /virtual/main.c:3:
In file included from /lib/modules/4.9.140/build/include/net/sock.h:51:
In file included from /lib/modules/4.9.140/build/include/linux/netdevice.h:38:
In file included from /lib/modules/4.9.140/build/include/linux/dmaengine.h:20:
In file included from /lib/modules/4.9.140/build/include/linux/device.h:24:
In file included from /lib/modules/4.9.140/build/include/linux/pinctrl/devinfo.h:21:
In file included from /lib/modules/4.9.140/build/include/linux/pinctrl/consumer.h:17:
In file included from /lib/modules/4.9.140/build/include/linux/seq_file.h:10:
/lib/modules/4.9.140/build/include/linux/fs.h:2745:9: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
if (id < 0 || id >= READING_MAX_ID)
~~ ^ ~
1 warning generated.
bpf: Failed to load program: Invalid argument
Traceback (most recent call last):
File "/usr/sbin/tcptop-bpfcc", line 203, in <module>
b = BPF(text=bpf_text)
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 308, in __init__
self._trace_autoload()
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 916, in _trace_autoload
fn = self.load_func(func_name, BPF.KPROBE)
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 348, in load_func
(func_name, errstr))
Exception: Failed to load BPF program kprobe__tcp_cleanup_rbuf: Invalid argument
Does the Nano kernel support BPF/eBPF ? If yes, How we should use it in Nano?