New API in Collection{Spec} for modifying global BPF variables
Describe the bug
-- Newbie here, text to be adjusted --
Opening this issue to discuss a possible enhancement to the library regarding the interaction with static/global variables in an eBPF program. AFAIU, the current state of the library doesn't allow to interact with such data, since the map containing these varaibles (".rodata", ".data", ".bss") are not emitted (referring to https://github.com/cilium/ebpf/blob/main/cmd/bpf2go/main.go#L367 and https://github.com/cilium/ebpf/blob/main/cmd/bpf2go/gen/output.go#L108).
Useful pointers:
- https://github.com/cilium/ebpf/discussions/943
- https://stackoverflow.com/questions/78742654/how-does-mmaped-ebpf-map-shared-between-processes-synchronizes-operations
Ongoing effort:
Map.Memoryandebpf.Variablesupport: https://github.com/ti-mo/ebpf/tree/tb/ebpf-variablesbpf2gosupport forebpf.Variable: #1543 (rebased on https://github.com/ti-mo/ebpf/tree/tb/ebpf-variables plus some required hack)
cc @ti-mo PTAL
This was merged in https://github.com/cilium/ebpf/pull/1572. bpf2go work continuing in https://github.com/cilium/ebpf/pull/1543.