diff --git a/pkg/beyla/os_nonlinux.go b/pkg/beyla/os_nonlinux.go index 9964c0c1a..7aa9b6b98 100644 --- a/pkg/beyla/os_nonlinux.go +++ b/pkg/beyla/os_nonlinux.go @@ -9,3 +9,7 @@ func CheckOSSupport() error { func CheckOSCapabilities(_ *Config) error { return nil } + +func KernelVersion() (major, minor int) { + return 5, 17 +} diff --git a/pkg/internal/discover/attacher_nolinux.go b/pkg/internal/discover/attacher_nolinux.go index 88f7c8206..b6e23fe1a 100644 --- a/pkg/internal/discover/attacher_nolinux.go +++ b/pkg/internal/discover/attacher_nolinux.go @@ -10,4 +10,4 @@ func (ta *TraceAttacher) init() error { func (ta *TraceAttacher) close() {} -func UnmountBPFFS(pinPath string, log *slog.Logger) {} +func UnmountBPFFS(_ string, _ *slog.Logger) {} diff --git a/pkg/internal/ebpf/tracer.go b/pkg/internal/ebpf/tracer.go index 3a9a77fc3..eeeb9794c 100644 --- a/pkg/internal/ebpf/tracer.go +++ b/pkg/internal/ebpf/tracer.go @@ -6,7 +6,6 @@ import ( "log/slog" "github.com/cilium/ebpf" - "github.com/cilium/ebpf/link" ebpfcommon "github.com/grafana/beyla/pkg/internal/ebpf/common" "github.com/grafana/beyla/pkg/internal/exec" @@ -100,12 +99,6 @@ type UtilityTracer interface { type ProcessTracerType int -type instrumenter struct { - offsets *goexec.Offsets - exe *link.Executable - closables []io.Closer -} - const ( Go = ProcessTracerType(iota) Generic diff --git a/pkg/internal/ebpf/tracer_darwin.go b/pkg/internal/ebpf/tracer_darwin.go index 48727814d..6c4c3052c 100644 --- a/pkg/internal/ebpf/tracer_darwin.go +++ b/pkg/internal/ebpf/tracer_darwin.go @@ -10,6 +10,9 @@ import ( "github.com/grafana/beyla/pkg/internal/request" ) +type instrumenter struct { +} + // dummy implementations to avoid compilation errors in Darwin. // The tracer component is only usable in Linux. func (pt *ProcessTracer) Run(_ context.Context, _ chan<- []request.Span) {} @@ -22,7 +25,7 @@ func (pt *ProcessTracer) Init() error { return nil } -func BuildPinPath(cfg *beyla.Config) string { +func BuildPinPath(_ *beyla.Config) string { return "" } diff --git a/pkg/internal/ebpf/tracer_linux.go b/pkg/internal/ebpf/tracer_linux.go index 87e7cf0c1..a42077fd1 100644 --- a/pkg/internal/ebpf/tracer_linux.go +++ b/pkg/internal/ebpf/tracer_linux.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "io" "log/slog" "os" "path" @@ -18,6 +19,7 @@ import ( "github.com/grafana/beyla/pkg/beyla" common "github.com/grafana/beyla/pkg/internal/ebpf/common" "github.com/grafana/beyla/pkg/internal/exec" + "github.com/grafana/beyla/pkg/internal/goexec" "github.com/grafana/beyla/pkg/internal/request" ) @@ -25,6 +27,12 @@ var loadMux sync.Mutex func ptlog() *slog.Logger { return slog.With("component", "ebpf.ProcessTracer") } +type instrumenter struct { + offsets *goexec.Offsets + exe *link.Executable + closables []io.Closer +} + func NewProcessTracer(cfg *beyla.Config, tracerType ProcessTracerType, programs []Tracer) *ProcessTracer { return &ProcessTracer{ Programs: programs,