Getting the bcc tools working on Fedora 27


While digging through the Ansible gluster_volume module I wanted to fire up the bcc execsnoop utility to see what commands were being run. When I ran it from the shell I got the following error:

$ execsnoop | grep gluster

Traceback (most recent call last):
  File "./execsnoop", line 21, in <module>
    from bcc.utils import ArgString, printb
ImportError: cannot import name 'ArgString'

I started poking around /usr/lib/python3.6/site-packages/bcc and noticed that the AggString and printb functions weren’t present in utils.py. The version of python3-bcc that ships with Fedora 27 is a bit dated and doesn’t contain these functions. As a quick fix I downloaded the latest version of utils.py from GitHUB and replaced the version on my debug host. That fixed the problem and I was bcc’ing away. I’m planning to file a bug later today (if one doesn’t exist) to get the latest version added.

This article was posted by Matty on 2018-02-25 09:37:34 -0500 -0500