-
When trying to test my project, an error is raised from the auto-generated kprobe_bpf.go file. It's coming from this line, and seems to go away when I fix the comment by adding a space to change the comment to "// go..." This auto-generated file says "DO NOT EDIT" at the top. Will modifying this comment in the file cause any issues? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@camrynl First, please read up on what I think the error is rather clear:
Adding the space indeed makes the compiler treat the annotation as a normal comment and will thus no longer embed the file during compilation.
No, but it will be overwritten by bpf2go next time you rebuild your eBPF program.
Your program won't contain any BPF bytecode and so will fail to be loaded into the kernel. I think that qualifies as problematic. 🙂 |
Beta Was this translation helpful? Give feedback.
@camrynl First, please read up on what
go:embed
is: https://blog.jetbrains.com/go/2021/06/09/how-to-use-go-embed-in-go-1-16.I think the error is rather clear:
kprobe_bpf.o
does not exist, which means you've likely removed it after running bpf2go or forgotten to check it into version control. For most use cases, we recommend checking in the BPF object since it means your package becomesgo get
table and will not require LLVM or bpf2go to be installed on your CI infrastructure.Adding the space indeed makes the compiler treat the annotation as a normal comment and will thus no longer embed the fi…