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

Exception: Failed to compile BPF module <text> #12

Closed
arjuntemura opened this issue Jun 18, 2023 · 3 comments
Closed

Exception: Failed to compile BPF module <text> #12

arjuntemura opened this issue Jun 18, 2023 · 3 comments
Labels
question Further information is requested

Comments

@arjuntemura
Copy link

arjuntemura commented Jun 18, 2023

I am facing the following error after running the code for Meshinsight's profiler:

ryzen02@ryzen02-rs-iiitd:~/meshinsight$ sudo python3 ./meshinsight/profiler/offline_profiler.py --latency --cpu
18-Jun-23 18:35:42 |     INFO | Starting latency profiling!
In file included from /virtual/main.c:2:
In file included from include/uapi/linux/ptrace.h:143:
In file included from ./arch/x86/include/asm/ptrace.h:5:
./arch/x86/include/asm/segment.h:266:2: error: expected '(' after 'asm'
        alternative_io ("lsl %[seg],%[p]",
        ^
./arch/x86/include/asm/alternative.h:240:2: note: expanded from macro 'alternative_io'
        asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature)   \
        ^
include/linux/compiler_types.h:214:24: note: expanded from macro 'asm_inline'
#define asm_inline asm __inline
                       ^
/virtual/main.c:53:9: error: no member named 'atomic_increment' in 'struct avg_table_t'
    avg.atomic_increment(lat, delta);
    ~~~ ^
/virtual/main.c:54:9: error: no member named 'atomic_increment' in 'struct avg_table_t'
    avg.atomic_increment(cnt);
    ~~~ ^
/virtual/main.c:59:10: error: no member named 'atomic_increment' in 'struct dist_table_t'
    dist.atomic_increment(bpf_log2l(delta));
    ~~~~ ^
4 errors generated.
Traceback (most recent call last):
  File "/home/ryzen02/meshinsight/meshinsight/profiler/latency/funclatency.py", line 345, in <module>
    b = BPF(text=bpf_text)
  File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 343, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>
Traceback (most recent call last):
  File "./meshinsight/profiler/offline_profiler.py", line 596, in <module>
    syscall_overhead  = profile_syscall(args.duration)
  File "./meshinsight/profiler/offline_profiler.py", line 41, in profile_syscall
    result = subprocess.run(cmd, stdout=subprocess.PIPE, check=True)
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['python3', '/home/ryzen02/meshinsight/meshinsight/profiler/latency/funclatency.py', '-p 6234', 'c:getpid', '-d 30']' returned non-zero exit status 1.

I am using Linux kernel version 5.4.0 , Ubuntu 18.04, Python 3.8, libllvm 6.0 , libclang 6.0 , llvm 6.0

I would be obliged if someone can help with this !

@Romero027
Copy link
Member

Thanks for trying MeshInsight!

It seems to be a BCC issue - will this help? iovisor/bcc#3752

@arjuntemura
Copy link
Author

Thanks for trying MeshInsight!

It seems to be a BCC issue - will this help? iovisor/bcc#3752

Hi @Romero027
I believe Ubuntu 18.04 and kernel 5.4 have problems in installing bcc. https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/12052

Could you let me know the ideal version for my ubuntu machine and kernel in order to run MeshInsight?

@Romero027 Romero027 added the question Further information is requested label Jun 19, 2023
@Romero027
Copy link
Member

Romero027 commented Jun 19, 2023

MeshInsight should work on Ubuntu 20.04.

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

No branches or pull requests

2 participants