MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / setupManagerOptions

Method setupManagerOptions

user/module/syscall.go:83–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81}
82
83func (this *MSyscall) setupManagerOptions() {
84 // 对于没有开启 CONFIG_DEBUG_INFO_BTF 的加载额外的 btf.Spec
85 if this.mconf.ExternalBTF != "" {
86 byteBuf, err := assets.Asset("user/assets/" + this.mconf.ExternalBTF)
87 if err != nil {
88 this.logger.Fatalf("[setupManagerOptions] failed, err:%v", err)
89 return
90 }
91 spec, err := btf.LoadSpecFromReader((bytes.NewReader(byteBuf)))
92
93 this.bpfManagerOptions = manager.Options{
94 DefaultKProbeMaxActive: 512,
95 VerifierOptions: ebpf.CollectionOptions{
96 Programs: ebpf.ProgramOptions{
97 LogSize: 2097152,
98 KernelTypes: spec,
99 },
100 },
101 RLimit: &unix.Rlimit{
102 Cur: math.MaxUint64,
103 Max: math.MaxUint64,
104 },
105 }
106 } else {
107 this.bpfManagerOptions = manager.Options{
108 DefaultKProbeMaxActive: 512,
109 VerifierOptions: ebpf.CollectionOptions{
110 Programs: ebpf.ProgramOptions{
111 LogSize: 2097152,
112 },
113 },
114 RLimit: &unix.Rlimit{
115 Cur: math.MaxUint64,
116 Max: math.MaxUint64,
117 },
118 }
119 }
120}
121
122func (this *MSyscall) Start() error {
123 return this.start()

Callers 1

startMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected