go-delve/delve · error

eBPF is disabled

Error message

eBPF is disabled

What it means

On builds without eBPF support (helpers_disabled.go, e.g. non-Linux platforms or builds with the ebpf tag off), EBPFContext is a stub and every attach operation returns 'eBPF is disabled'. eBPF-based non-stop tracing is simply unavailable in this binary.

Source

Thrown at pkg/proc/internal/ebpf/helpers_disabled.go:18

//go:build !linux || !amd64 || !go1.16

package ebpf

import (
	"debug/elf"
	"errors"
)

type EBPFContext struct {
}

func (ctx *EBPFContext) Close() {

}

func (ctx *EBPFContext) AttachUprobe(pid int, name string, offset uint32) error {
	return errors.New("eBPF is disabled")
}

func (ctx *EBPFContext) AttachURetprobe(pid int, name string, offset uint32) error {
	return errors.New("eBPF is disabled")
}

func (ctx *EBPFContext) UpdateArgMap(key uint64, goidOffset int64, args []UProbeArgMap, gAddrOffset uint64, isret bool) error {
	return errors.New("eBPF is disabled")
}

func (ctx *EBPFContext) GetBufferedTracepoints() []RawUProbeParams {
	return nil
}

func SymbolToOffset(file, symbol string) (uint32, error) {
	return 0, errors.New("eBPF disabled")
}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Use trace without --ebpf (regular breakpoint-based tracing) on unsupported platforms
  2. On Linux, build delve with eBPF support: make build-ebpf-object followed by make build/install
  3. Install a delve build for linux/amd64 or linux/arm64 that includes the compiled eBPF objects
  4. Check 'dlv --help'/version or build tags to confirm whether your binary supports eBPF

Example fix

// before (macOS / unsupported build)
dlv trace --ebpf main.foo
// error: eBPF is disabled
// after (linux, with eBPF built)
make build-ebpf-object && make build
./dlv trace --ebpf main.foo
Defensive patterns

Strategy: fallback

Validate before calling

// detect eBPF support before requesting it:
if runtime.GOOS != "linux" {
    return errors.New("eBPF tracing requires linux; omit --ebpf")
}

Try / catch

if err := runTrace(useEBPF); err != nil {
    if strings.Contains(err.Error(), "eBPF is disabled") {
        log.Println("this delve build lacks eBPF; retrying with standard breakpoints")
        return runTrace(false)
    }
    return err
}

Prevention

When it happens

Trigger: Running 'dlv trace --ebpf' or any code path calling AttachUprobe/AttachURetprobe with a Delve binary compiled without eBPF support (macOS/Windows, or linux build without the ebpf build tag / compiled object).

Common situations: Using delve installed from macOS/Windows package managers and passing --ebpf; a linux dlv binary built without the eBPF object (make build-ebpf-object not run); distro packages compiled without eBPF support.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/6f9d6cf7d7ae5ed3. Report an issue: GitHub.