Skip to content
Discussion options

You must be logged in to vote

You're correct, there currently isn't an API to automatically attach programs. The reason is that not all program types carry all the necessary information in the ELF. For example, we can't know which interface to attach an XDP program to.

In your case, would something like the following work?

err = link.AttachKprobe(progSpec.AttachTo, struct.myProgramname)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@f18m
Comment options

@lmb
Comment options

lmb Mar 20, 2024
Maintainer

Answer selected by f18m
Comment options

You must be logged in to vote
0 replies
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