bpfloader: add option to clear maps on restart
If the bpfloader process restarts for any reason, the BPF programs it
is responsible for attaching to tracepoints become temporarily
detached, potentially leading to missed events and stale data.
Add a new should_clear field for BPF map definitions, indicating maps
that need to be cleared when bpfloader restarts, and implement this
functionality for hash and array maps.
Also add new macros to bpf_helpers.h to allow BPF programs to
concisely define maps while setting the new should_clear field.
Change-Id: Ifcd6a713595feb1a018ac86de50f53e6d0fcc550
Signed-off-by: Connor O'Brien <connoro@google.com>
4 files changed