Conversation
2a2f948 to
d02c6b1
Compare
ti-mo
left a comment
There was a problem hiding this comment.
Thanks for the patch!
I find it a bit of a missed opportunity that this requires user space to specify a different attach type to the link as it invites unnecessary complexity, adding corner cases to otherwise straightforward logic.
The kernel could attach the prog to entry and return if prog->expected_attach_type is KPROBE_SESSION. What was the rationale here? Backwards compat?
I think the reason was to keep it similar to other links with having link->attach_type == prog->expected_attach_type, |
Signed-off-by: Jiri Olsa <[email protected]>
450704e to
638d6b6
Compare
…sion) Adding support to attach kprobe multi link as session [1] by adding Session bool to KprobeMultiOptions. When set true it attaches the link with BPF_TRACE_KPROBE_SESSION attach_type, which means: - program is attached to both function entry and return - entry program can decided if the return program gets executed - entry program can share u64 cookie value with return program [1] https://lore.kernel.org/bpf/[email protected]/ Signed-off-by: Jiri Olsa <[email protected]> Co-authored-by: Timo Beckers <[email protected]>
ti-mo
left a comment
There was a problem hiding this comment.
@olsajiri I've made a few changes:
- Session landed in 6.10, not 6.9.
TestKprobeSessionis now gated onhaveBPFLinkKprobeMulti()(instead of the newhaveBPFLinkKprobeSession()) so it's also exercised on kernels with multi but without session. This makes sure KprobeMulti correctly returnsErrNotSupportedon those kernels, which was previously broken, see next:- Feature probes are run before the blanket EINVAL check, which would previously always return the
missing kernel symbol or prog...error instead of returningErrNotSupportedin the error path. - Added
TestHaveBPFLinkKprobeSessionto test the feature probe.
dylandreimerink
left a comment
There was a problem hiding this comment.
Latest version looks good to me
kprobe session support plus 6.11 kernel update