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

BPF import error #1

Open
schwarzschild-radius opened this issue Feb 7, 2020 · 15 comments
Open

BPF import error #1

schwarzschild-radius opened this issue Feb 7, 2020 · 15 comments

Comments

@schwarzschild-radius
Copy link

I am getting the following error while running schedtime. I remember following the instructions to install bcc.

Traceback (most recent call last):
  File "./schedtime", line 23, in <module>
    from bcc import BPF
ImportError: cannot import name BPF
@mfleming
Copy link
Owner

mfleming commented Feb 7, 2020

This is probably a path issue. Which version(s) of python do you have on your system and did the bcc package install to the correct place? You find bcc's installation directory with $(find /usr -name bcc -type d). You should see it somewhere like /usr/lib/python3/dist-packages/bcc.

@stefanodoni
Copy link

Yes: /usr/lib/python3/dist-packages/bcc

@schwarzschild-radius
Copy link
Author

schwarzschild-radius commented Feb 9, 2020

I have both python2 and python3. I installed bcc using pip2(python2). I am still getting the same error. I also tried with python3 but the same result. There is a similar issue in another repo : iovisor/bcc#2278

Is there a docker image?

@stefanodoni
Copy link

stefanodoni commented Feb 9, 2020 via email

@mfleming
Copy link
Owner

I have both python2 and python3. I installed bcc using pip2(python2). I am still getting the same error. I also tried with python3 but the same result. There is a similar issue in another repo : iovisor/bcc#2278

Is there a docker image?

There's no docker image, I'm afraid.

BCC isn't available in pip, and https://pypi.org/project/bcc/ has nothing to do with BPF so you're going to need to install the python-bcc package from your distribution or build it from source.

@mfleming
Copy link
Owner

I now get a Segmentation Fault though...

Can you use gdb to get a stacktrace to see why it's segfaulting?

@stefanodoni
Copy link

stefanodoni commented Feb 17, 2020 via email

@mfleming
Copy link
Owner

mfleming commented Feb 23, 2020

$ gdb <path to schedtime>
(gdb) run <whatever schedtime args cause the segfault>
HIT SEGFAULT
(gdb) bt

@stefanodoni
Copy link

Sorry for the late reply - I can't get the stacktrace:

$ sudo gdb ./schedtime
...
"/home/.../performance-tools/./schedtime": not in executable format: File format not recognized
(gdb) run ls
Starting program: ls
No executable file specified.
Use the "file" or "exec-file" command.

Any hint?

@mfleming
Copy link
Owner

Sorry, try:

$ sudo gdb python
(gdb) run ./schedtime

@stefanodoni
Copy link

stefanodoni commented Mar 11, 2020 via email

@mfleming
Copy link
Owner

mfleming commented Mar 12, 2020 via email

@stefanodoni
Copy link

stefanodoni commented Mar 13, 2020 via email

@stefanodoni
Copy link

Hi @mfleming

Any news on the BCC error?

Thank you!

@mfleming
Copy link
Owner

@stefanodoni are you still hitting this error?

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

3 participants