go-ebpf-examples icon indicating copy to clipboard operation
go-ebpf-examples copied to clipboard

Go eBPF examples

Experimenting eBPF with Go

Prerequisites

These examples have been created on an Archlinux box with kernel v5.0.

The main prerequisites are:

Working examples

  • helloworld

    • make bin/helloworld
    • kprobe(clone) + trace_pipe + iovisor/gobpf/bcc (helloworld/main.go)
  • countpackets

    • make bin/countpackets
    • socket filter + map (pkts.c) + iovisor/gobpf/elf (countpackets/main.go)
  • catchcats

  • ministrace