On Wednesday, July 16, 2025 1:23 AM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> write: [......] > > The right answer here is you need to know what's attachable and what's > not, instead of just ignoring attachment failures somewhere deep > inside libbpf API. Filter and check before you try to attach. There is > /sys/kernel/tracing/available_filter_functions and some similar > blacklist file, consult that, filter out stuff that's not attachable. > > We won't be adding libbpf APIs just to make some selftests easier to > write by being sloppy. > > > > > This should be a common use case. And let me do more research to see if > > we can do such filter out of the libbpf. > > I have similar issues with retsnoop ([0]) and do just fine without > abusing libbpf API. > > [0] https://github.com/anakryiko/retsnoop/blob/master/src/mass_attacher.c#L749 Thank you for the reference, and I think it will work to do such filtering in the selftests.