Skip to content

Commit

Permalink
features: implement StructOps program type probe
Browse files Browse the repository at this point in the history
ENOTSUPP means the program type is available.

Signed-off-by: Timo Beckers <timo@isovalent.com>
  • Loading branch information
ti-mo committed Jul 22, 2022
1 parent 1e9bf7a commit 33579cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion features/prog.go
Expand Up @@ -151,6 +151,10 @@ func haveProgramType(pt ebpf.ProgramType) error {
case errors.Is(err, unix.EPERM):
break

// ENOTSUPP means the program type is at least known to the kernel.
case errors.Is(err, unix.ENOTSUPP):
err = nil

// Wrap unexpected errors.
case err != nil:
err = fmt.Errorf("unexpected error during feature probe: %w", err)
Expand Down Expand Up @@ -248,7 +252,7 @@ func haveProgramHelper(pt ebpf.ProgramType, helper asm.BuiltinFunc) error {

func progLoadProbeNotImplemented(pt ebpf.ProgramType) bool {
switch pt {
case ebpf.Tracing, ebpf.StructOps, ebpf.Extension, ebpf.LSM:
case ebpf.Tracing, ebpf.Extension, ebpf.LSM:
return true
}
return false
Expand Down

0 comments on commit 33579cb

Please sign in to comment.