Skip to content

comments in auto-generated kprobe_bpf.go file causing errors #695

Answered by ti-mo
camrynl asked this question in Q&A
Discussion options

You must be logged in to vote

@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 becomes go gettable and will not require LLVM or bpf2go to be installed on your CI infrastructure.

seems to go away when I fix the comment by adding a space to change the comment to "// go..."

Adding the space indeed makes the compiler treat the annotation as a normal comment and will thus no longer embed the fi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lmb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants