Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to use bcc on debian 10, v5.8.5 kernel #3081

Open
mmelo-yottaa opened this issue Aug 31, 2020 · 4 comments
Open

trying to use bcc on debian 10, v5.8.5 kernel #3081

mmelo-yottaa opened this issue Aug 31, 2020 · 4 comments

Comments

@mmelo-yottaa
Copy link

I am trying to use bcc python bindings on Debian 10 with v5.8.5 kernel I built. Using the apt-install Debian 10 bcc package I get this failure:

mike@debian$ python bindtrace.py
In file included from /virtual/main.c:2:
In file included from /lib/modules/5.8.5/build/include/linux/sched.h:14:
In file included from /lib/modules/5.8.5/build/include/linux/pid.h:5:
In file included from /lib/modules/5.8.5/build/include/linux/rculist.h:11:
In file included from /lib/modules/5.8.5/build/include/linux/rcupdate.h:26:
In file included from /lib/modules/5.8.5/build/include/linux/irqflags.h:16:
In file included from /lib/modules/5.8.5/build/arch/x86/include/asm/irqflags.h:9:
In file included from /lib/modules/5.8.5/build/arch/x86/include/asm/nospec-branch.h:256:
/lib/modules/5.8.5/build/arch/x86/include/asm/segment.h:266:2: error: expected '(' after 'asm'
alternative_io ("lsl %[seg],%[p]",
^
/lib/modules/5.8.5/build/arch/x86/include/asm/alternative.h:240:2: note: expanded from macro 'alternative_io'
asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature)
^

From reading #2573 it seems I might be well off building a new bcc. This was not easy, I uninstalled Debian 10 LLVM/clang and installed version 3.8 from Debian 9 (stretch) to match the instructions here:

https://github.com/iovisor/bcc/blob/master/INSTALL.md#debian---source

There were issues using newer Debian 10 LLVM/clang versions, lots of warnings during build, also errors and failed tests.

After down-rev'ing LLVM/clang, and installing all other prerequisites per the above URL, the build completed but a large number of tests fail. I can forward bcc_0.16.0-1_amd64.build if that is interesting.

Could you please point me at instructions for building bcc on Debian 10 that work? I can up-rev or down-rev installed components at necessary, although I prefer to use latest bcc / kernel / buildtools.

Thank you.

@javierhonduco
Copy link
Contributor

Haven't investigated much yet but seems similar to the error I bumped into. The BPF / BCC Python code is the same, but with different kernel versions:

@yonghong-song Does this ring a bell?

@javierhonduco
Copy link
Contributor

javierhonduco commented Oct 6, 2020

Just saw 2d1497c! Ubuntu ships with 0.10 by default released on May 29, 2019, and the fix was introduced in v0.12.0 on Oct 11, 2019 😭

Related #2678

@spumer
Copy link

spumer commented Jan 24, 2021

I taking to the same issue but I was successfully install it for Debian 10 Buster by using @mika gist from #3224

Magic cmd is:

apt-get build-dep bpfcc

After that just follow common instruction:

Prepare deps:
Do not add line to /etc/apt/sources.* if you already have deb-src (not deb) source for buster main.

echo "deb-src http://deb.debian.org/debian buster main" | tee -a /etc/apt/sources.list.d/buster.list && \
apt-get update && \
apt-get build-dep bpfcc -y && \
apt-get install git clang -y

Build:

cd /usr/src/
git clone https://github.com/iovisor/bcc/
mkdir bcc/build
cd bcc/build
cmake -DPYTHON_CMD=python3 ..
make
make install
pushd src/python/
make
make install
popd

@insave-hosting
Copy link

Debian 11
apt install python3-bpfcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants