You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kprobe and Kretprobe both have the same program type, so the library can't guard against using the wrong attachment hooks (see #1490 (comment)). Figuring out whether a program is a kretprobe currently involves doing a string match on ProgramSpec.SectionName. It would be nice to do one at least of the following.
Make it so that link.Kprobe returns an error when passed a Kretprobe program. This requires either figuring out whether a program is a Kretprobe (hard, because programs can be loaded from a pin) or communicating it to link.Kprobe somehow. Maybe we can shoehorn this into ProgramSpec.AttachTo somehow, which is often passed directly to link.Kprobe etc. But does this create other breakage?
Make it easier to figure out if a ProgramSpec is a Kretprobe somehow (though a method on ProgramSpec seems really ugly?)
Add an example which shows how to attach kprobe / kretprobe based on the SectionName.
The text was updated successfully, but these errors were encountered:
Kprobe and Kretprobe both have the same program type, so the library can't guard against using the wrong attachment hooks (see #1490 (comment)). Figuring out whether a program is a kretprobe currently involves doing a string match on
ProgramSpec.SectionName
. It would be nice to do one at least of the following.link.Kprobe
returns an error when passed a Kretprobe program. This requires either figuring out whether a program is a Kretprobe (hard, because programs can be loaded from a pin) or communicating it tolink.Kprobe
somehow. Maybe we can shoehorn this intoProgramSpec.AttachTo
somehow, which is often passed directly tolink.Kprobe
etc. But does this create other breakage?The text was updated successfully, but these errors were encountered: