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
In NewCollectionWithOptions [1], if a program fails to load, the entire collection will be discarded. However, there are scenarios that require a "best-effort" approach, where the failed program is skipped, and a collection containing only the successfully loaded programs is returned.
Our use case involves a monitoring program for various LSM tracepoints. Before loading the collection, we do not know if the current kernel supports all the tracepoints. We want to skip those programs not supported by the kernel and continue using the remaining ones.
To achieve this, it might be necessary to add a field "AcceptFailure" to the CollectionOptions. This field would indicate whether each program in the CollectionSpec can be skipped if it fails to load.
AcceptFailure invites silent breakage, so on the surface that doesn't sound like a good idea. Do you have an example set of programs that would only partially load? Do they have an lsm/ prefix in the ELF? I haven't tried using those, so I don't know the common failure scenarios.
A middle ground could be using LoadAndAssign to indicate which subset of programs you're interested in loading. Programs that don't appear in the input struct won't be handed to the kernel. I assume your application depends on having at least some programs successfully loaded. You could progressively fall back to a smaller and smaller subset of programs depending on what the kernel will accept.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In
NewCollectionWithOptions
[1], if a program fails to load, the entire collection will be discarded. However, there are scenarios that require a "best-effort" approach, where the failed program is skipped, and a collection containing only the successfully loaded programs is returned.Our use case involves a monitoring program for various LSM tracepoints. Before loading the collection, we do not know if the current kernel supports all the tracepoints. We want to skip those programs not supported by the kernel and continue using the remaining ones.
To achieve this, it might be necessary to add a field "AcceptFailure" to the
CollectionOptions
. This field would indicate whether each program in theCollectionSpec
can be skipped if it fails to load.What do you think about this?
Cc: @alban
[1] https://github.com/cilium/ebpf/blob/main/collection.go#L385
Beta Was this translation helpful? Give feedback.
All reactions