Help us shape the future of Go! Take the 2026 Go Developer Survey

multiple-objects

command module
v0.0.0-...-96cbab3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

multiple-objects

This selftest demonstrates having multiple bpf objects which each have programs which rely on a single ringbuffer.

This is accomplished via map pinning. See the ringbuffer definition:

struct {
    __uint(pinning, LIBBPF_PIN_BY_NAME);
    __uint(type, BPF_MAP_TYPE_RINGBUF);
    __uint(max_entries, 1 << 24);
} events SEC(".maps");

The LIBBPF_PIN_BY_NAME attribute instructs libbpf to pin the map to a file in the bpf file system. When subsequent bpf maps are loaded by libbpf with the same name/attribute, libbpf will automatically reuse the file descriptor and wire it up as the same underly map.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL