| 58 | } |
| 59 | |
| 60 | func (this *PerfBRK) setupManagerOptions() { |
| 61 | if this.mconf.ExternalBTF != "" { |
| 62 | byteBuf, err := assets.Asset("user/assets/" + this.mconf.ExternalBTF) |
| 63 | if err != nil { |
| 64 | this.logger.Fatalf("[setupManagerOptions] failed, err:%v", err) |
| 65 | return |
| 66 | } |
| 67 | spec, err := btf.LoadSpecFromReader((bytes.NewReader(byteBuf))) |
| 68 | |
| 69 | this.bpfManagerOptions = manager.Options{ |
| 70 | DefaultKProbeMaxActive: 512, |
| 71 | VerifierOptions: ebpf.CollectionOptions{ |
| 72 | Programs: ebpf.ProgramOptions{ |
| 73 | LogSize: 2097152, |
| 74 | KernelTypes: spec, |
| 75 | }, |
| 76 | }, |
| 77 | RLimit: &unix.Rlimit{ |
| 78 | Cur: math.MaxUint64, |
| 79 | Max: math.MaxUint64, |
| 80 | }, |
| 81 | } |
| 82 | } else { |
| 83 | this.bpfManagerOptions = manager.Options{ |
| 84 | DefaultKProbeMaxActive: 512, |
| 85 | VerifierOptions: ebpf.CollectionOptions{ |
| 86 | Programs: ebpf.ProgramOptions{ |
| 87 | LogSize: 2097152, |
| 88 | }, |
| 89 | }, |
| 90 | RLimit: &unix.Rlimit{ |
| 91 | Cur: math.MaxUint64, |
| 92 | Max: math.MaxUint64, |
| 93 | }, |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func (this *PerfBRK) GetConf() config.IConfig { |
| 99 | return this.mconf |