Bcc: Building the source doesn't works on Fedora

Created on 22 Feb 2017  路  7Comments  路  Source: iovisor/bcc

I followed the instructions at the Source section of INSTALL.md for Fedora and after installing it I'm getting:

[root@b3ddd27b6554 build]# /usr/share/bcc/tools/old/biosnoop
chdir(/lib/modules/4.9.7-101.fc24.x86_64/build): No such file or directory
Traceback (most recent call last):
  File "/usr/share/bcc/tools/old/biosnoop", line 97, in <module>
    """, debug=0)
  File "/usr/lib/python2.7/site-packages/bcc/__init__.py", line 277, in __init__
    raise Exception("Failed to compile BPF module %s" % src_file)
Exception: Failed to compile BPF module
[root@b3ddd27b6554 build]# cat /etc/*-release
Fedora release 25 (Twenty Five)
NAME=Fedora
VERSION="25 (Twenty Five)"
ID=fedora
VERSION_ID=25
PRETTY_NAME="Fedora 25 (Twenty Five)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:25"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=25
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=25
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
Fedora release 25 (Twenty Five)
Fedora release 25 (Twenty Five)
[root@b3ddd27b6554 build]# uname -a
Linux b3ddd27b6554 4.9.7-101.fc24.x86_64 #1 SMP Thu Feb 2 23:32:31 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I'm missing something?

Most helpful comment

NP. See this problem of missing kernel-devel or mismatched kernel/kernel-devel with systemtap. It would be nice if bcc was able to give a suggestion on how to fix this rather than just giving a rather raw message that it can't find a directory.

All 7 comments

bcc requires the kernel-devel rpm package that matches the currently running kernel to work.

I saw that on https://github.com/iovisor/bcc/issues/475 so I installed the package before:

[root@b3ddd27b6554 build]# dnf install kernel-devel
Last metadata expiration check: 0:36:41 ago on Wed Feb 22 14:47:38 2017.
Package kernel-devel-4.9.10-200.fc25.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

Oh and LLVM installed version is llvm-3.8.1-2.fc25.x86_64

The kernel-devel has to match up exactly with the running kernel. It looks like the kernel-devel in the container doesn't match up with the kernel that is currently running on the system. bcc complains:

chdir(/lib/modules/4.9.7-101.fc24.x86_64/build): No such file or directory

While dnf mentions:

Package kernel-devel-4.9.10-200.fc25.x86_64 is already installed, skipping.

Get kernel-devel-4.9.7-101.fc24.x86_64 installed in the container or update the machine to kernell-4.9.10-200.fc25.x86_64 and reboot with that newer kernel.

OH nice catch, my bad.

NP. See this problem of missing kernel-devel or mismatched kernel/kernel-devel with systemtap. It would be nice if bcc was able to give a suggestion on how to fix this rather than just giving a rather raw message that it can't find a directory.

I made a working Docker container that, hopefully, will work in F23, F24 and F25. Thanks @wcohen for the help.

Was this page helpful?
0 / 5 - 0 ratings