Skip to content

Commit

Permalink
user : increase buffer size of ebpf map
Browse files Browse the repository at this point in the history
change 64 to 1024. in Linux, will be 4K * 1024 = 4M.
improve #291

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n committed Feb 18, 2023
1 parent bf9dee6 commit bc63ea6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions user/module/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ const (
// 2022-12-16 改为 SSL_in_init
MasterKeyHookFuncBoringSSL = "SSL_in_init"
)

// buffer size times of ebpf perf map
// buffer size = BufferSizeOfEbpfMap * os.pagesize
const BufferSizeOfEbpfMap = 1024
2 changes: 1 addition & 1 deletion user/module/imodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (this *Module) readEvents() error {
}

func (this *Module) perfEventReader(errChan chan error, em *ebpf.Map) {
rd, err := perf.NewReader(em, os.Getpagesize()*64)
rd, err := perf.NewReader(em, os.Getpagesize()*BufferSizeOfEbpfMap)
if err != nil {
errChan <- fmt.Errorf("creating %s reader dns: %s", em.String(), err)
return
Expand Down

0 comments on commit bc63ea6

Please sign in to comment.