libbpf-tools: update execsnoop for libbpf 1.0
[platform/upstream/bcc.git] / FAQ.txt
1 Q: while running 'make test' I'm seeing:
2    'ImportError: No module named pyroute2'
3 A: Install pyroute2:
4    git clone https://github.com/svinota/pyroute2.git
5    cd pyroute2; sudo make install
6
7 Q: hello_world.py fails with:
8    OSError: libbcc.so: cannot open shared object file: No such file or directory
9 A: make sure to 'make install' and add the directory
10    where libbcc.so was installed into your LD_LIBRARY_PATH
11    export LD_LIBRARY_PATH=$(dirname `find /usr -name libbcc.so`):$LD_LIBRARY_PATH
12
13 Q: hello_world.py fails with:
14    ImportError: No module named bcc
15 A: checkout "sudo make install" output to find out bpf package installation site,
16    add it to the PYTHONPATH env variable before running the program.
17    export PYTHONPATH=$(dirname `find /usr/lib -name bcc`):$PYTHONPATH
18
19 Q: hello_world.py still fails with:
20    bpf: Operation not permitted
21    Exception: Failed to load BPF program hello
22 A: sudo
23
24 Q: hello_world.py fails with
25    bpf: Failed to load program: Operation not permitted
26    despite running as root, and strace shows each `bpf()` system call failing with an EPERM.
27 A: The so-called Kernel lockdown might be the root cause. Try disabling it with the so-called
28    sysrq mechanism:
29        echo 1 > /proc/sys/kernel/sysrq
30        echo x > /proc/sysrq-trigger
31    Also see https://github.com/iovisor/bcc/issues/2525
32    
33    If you have Secure Boot enabled you need to press Alt-PrintScr-x on the keyboard instead:
34    ```
35    This sysrq operation is disabled from userspace.
36    sysrq: Disabling Secure Boot restrictions
37    Lifting lockdown
38    ```
39
40 Q: How do I fulfill the Linux kernel version requirement?
41 A: You need to obtain a recent version of the Linux source code
42    (please look at the README for the exact version), enable the
43    configuration options listed in the README file, install the image,
44    modules and headers, update your bootloader and reboot into the new
45    kernel.
46
47    If you want to compile your own kernel, you can fetch the sources
48    from kernel.org or through your Linux distribution.
49    To install, you need all of the following:
50       make install
51       make modules_install
52       make headers_install INSTALL_HDR_PATH=/usr/local/
53
54 Q: hello_world.py fails with:
55    ImportError: No module named past.builtins
56 A: sudo pip install future
57
58 Q: Running one of the bcc tools produces an import error:
59    Traceback (most recent call last):
60    File "./execsnoop", line 20, in <module>
61      from bcc import BPF
62    ImportError: No module named bcc
63 A: Make sure the python bcc bindings package (python2-bcc) is installed.