-
Alban Crequy authored
gobpf users can set the 'overwritable' bit with the SectionParams struct. Example: > import ( > bpflib "github.com/iovisor/gobpf/elf" > ) > [...] > sectionParams := make(map[string]bpflib.SectionParams) > sectionParams["maps/events"] = bpflib.SectionParams{ > PerfRingBufferPageCount: 64, > PerfRingBufferBackward: true, > PerfRingBufferOverwritable: true, > } > err = m.Load(sectionParams) Traceloop needs its ring buffers to be both backward and overwritable. Implementation notes: the Linux API defines the 'backward' and 'overwritable' bits as follow: - The 'backward' bit is defined in struct perf_event_attr, used in the perf_event_open() syscall. See implementation: https://github.com/torvalds/linux/commit/d1b26c70246bc72922ae61d9f972d5c2588409e7 - The 'overwritable' bit is set in the mmap() syscall via PROT_WRITE, see Linux's commit message: https://github.com/torvalds/linux/commit/9ecda41acb971ebd07c8fb35faf24005c0baea12
c0f1c87b