Open zxc199108 opened 2 years ago
python3 funclatency.py -p 7219 -u do_nanosleep
You need to rebuild and install BCC.
How to rebuild BCC?
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.
For someone who encountered the same error: https://github.com/iovisor/bcc/issues/3911#issuecomment-1073399703 may help
/virtual/main.c:43:9: error: no member named 'atomic_increment' in 'struct avg_table_t' avg.atomic_increment(lat, delta);