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

use funclatency #3752

Open
zxc199108 opened this issue Dec 14, 2021 · 5 comments
Open

use funclatency #3752

zxc199108 opened this issue Dec 14, 2021 · 5 comments

Comments

@zxc199108
Copy link

/virtual/main.c:43:9: error: no member named 'atomic_increment' in 'struct avg_table_t'
avg.atomic_increment(lat, delta);
~~~ ^
/virtual/main.c:44:9: error: no member named 'atomic_increment' in 'struct avg_table_t'
avg.atomic_increment(cnt);
~~~ ^
/virtual/main.c:47:10: error: no member named 'atomic_increment' in 'struct dist_table_t'
dist.atomic_increment(bpf_log2l(delta));
~~~~ ^
3 errors generated.
Traceback (most recent call last):
File "funclatency.py", line 317, in
b = BPF(text=bpf_text)
File "/usr/lib/python3.6/site-packages/bcc/init.py", line 347, in init
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module

@zxc199108
Copy link
Author

python3 funclatency.py -p 7219 -u do_nanosleep

@chenhengqi
Copy link
Collaborator

You need to rebuild and install BCC.

@Zarak-Shah-ji
Copy link

How to rebuild BCC?

@bahamasbahamas
Copy link

bahamasbahamas commented Dec 15, 2022

After rebuilding and installing bcc, I received the same error when running funclatency.py in Pycharm.

/home/ubuntu/python35-setcap /home/ubuntu/bcc/tools/funclatency.py c:read 
/virtual/main.c:54:9: error: no member named 'atomic_increment' in 'struct avg_table_t'
    avg.atomic_increment(lat, delta);
    ~~~ ^
/virtual/main.c:55:9: error: no member named 'atomic_increment' in 'struct avg_table_t'
    avg.atomic_increment(cnt);
    ~~~ ^
/virtual/main.c:68:14: error: no member named 'atomic_increment' in 'struct dist_table_t'
        dist.atomic_increment(key);
        ~~~~ ^
3 errors generated.
Traceback (most recent call last):
  File "/home/ubuntu/bcc/tools/funclatency.py", line 345, in <module>
    b = BPF(text=bpf_text)
  File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 364, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>

I used these commands to run funclatency.py as root in Pycharm:

cp /usr/bin/python3 ~/python35-setcap
sudo setcap 'cap_net_bind_service=+ep' ~/python35-setcap

If I start funclatency.py with sudo funclatency-bpfcc c: read from the terminal, it works.

@Cycatz
Copy link

Cycatz commented Apr 13, 2023

For someone who encountered the same error: #3911 (comment) may help

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

5 participants