Skip to content

Commit 117c5ca

Browse files
authored
Merge branch 'main' into feat/traceCLI
2 parents 56690e8 + 2986359 commit 117c5ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/plugin/filter/filter_map_linux.go

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sync"
1212

1313
"github.com/cilium/ebpf"
14+
"github.com/cilium/ebpf/rlimit"
1415
"github.com/microsoft/retina/pkg/log"
1516
plugincommon "github.com/microsoft/retina/pkg/plugin/common"
1617
"github.com/microsoft/retina/pkg/utils"
@@ -44,6 +45,12 @@ func Init() (*FilterMap, error) {
4445
return f, nil
4546
}
4647

48+
// Allow the current process to lock memory for eBPF resources.
49+
if err := rlimit.RemoveMemlock(); err != nil {
50+
f.l.Error("RemoveMemlock failed", zap.Error(err))
51+
return f, err
52+
}
53+
4754
obj := &filterObjects{} //nolint:typecheck
4855
err := loadFilterObjects(obj, &ebpf.CollectionOptions{ //nolint:typecheck
4956
Maps: ebpf.MapOptions{

0 commit comments

Comments
 (0)