bcc-tools package installs the latest version of the kernel-devel package (if available) rather than the version of the running kernel

Solution Verified - Updated -

Issue

  • The bcc-tools package installs the latest version the kernel-devel package (if available) rather than the version of the running kernel. Due to this the execution of eBPF scripts fails with an error: chdir(/lib/modules/4.18.0-67.el8.x86_64/build): No such file or directory which requires manual installation of the correct version of the kernel-devel package.

Eg:

# uname -r
4.18.0-67.el8.x86_64

# rpm -q kernel-devel
package kernel-devel is not installed

# yum install bcc-tools

# rpm -q kernel-devel
kernel-devel-4.18.0-74.el8.x86_64

# /usr/share/bcc/tools/execsnoop
chdir(/lib/modules/4.18.0-67.el8.x86_64/build): No such file or directory
Traceback (most recent call last):
  File "/usr/share/bcc/tools/execsnoop", line 166, in <module>
    b = BPF(text=bpf_text)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 318, in __init__
    raise Exception("Failed to compile BPF text")
Exception: Failed to compile BPF text

Environment

  • Red Hat Enterprise Linux 8
  • bcc-tools
  • kernel-devel

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content