Closed grcevski closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
e263f8e
) 79.41% compared to head (0e52151
) 44.57%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm curious about the usage of
goto
instead of functions, is this a common pattern in eBPF programs or it's just to simplify things? Is this fixing #618?
Yeah, it's sort of common in eBPF. Each program is always individual single function and when we use functions we'd have to put __always_inline so that the verifier likes it. The only way to call in terms of a function call is to use bpf_tail_call.
So I think you are right, we could've made the cleanup a function and "call it", but then we'd have to make individual cleanup function for each probe, I thought this was simpler, but maybe I'm not considering some approach. If you have a cleaner code in mind, please shout :).
Is this fixing #618?
I hope it will. I'll ask on the issue if they can try with our main branch now once this is built.
Hi Nikola,
(...) when we use functions we'd have to put __always_inline so that the verifier likes it.
Is this a limitation of the way bpf2go
works? I'm not sure if/how it uses libbpf under the hood, but __always_inline
should only be required on older kernels (< 4.16
/< 5.5
). For the ones Beyla is targeting (>= 5.8
), function calls should work without inlining.
Oh maybe it's not needed anymore, I just keep using it by habbit.
Fixing number of places where we used the unsafe delete after use pattern.