Move ebpf code to its own package to avoid crash issues in Android (#1033)

* Move ebpf code to its own package to avoid crash issues in Android

Older versions of android crashes because of the bytecode files
Even when they aren't loaded as it was our case

* move c file to own folder

* fix lint
This commit is contained in:
Maycon Santos
2023-07-27 15:34:27 +02:00
committed by GitHub
parent 7794b744f8
commit 24713fbe59
8 changed files with 24 additions and 18 deletions

View File

@@ -0,0 +1,18 @@
//go:build linux
package ebpf
import (
"testing"
)
func Test_newEBPF(t *testing.T) {
ebpf := NewEBPF()
err := ebpf.Load(1234, 51892)
defer func() {
_ = ebpf.Free()
}()
if err != nil {
t.Errorf("%s", err)
}
}