in filter.go [349:373]
func (g *SyscallGroup) Assemble(defaultAction Action) ([]bpf.Instruction, error) {
if len(g.Names) == 0 && len(g.NamesWithCondtions) == 0 {
return nil, nil
}
// Validate the syscalls.
syscalls, err := g.toSyscallsWithConditions()
if err != nil {
return nil, err
}
p := NewProgram()
action := p.NewLabel()
for _, syscall := range syscalls {
syscall.Assemble(&p, action)
}
p.Ret(defaultAction)
p.SetLabel(action)
p.Ret(g.Action)
return p.Assemble()
}