I noticed that the data pointer in the libbpf ringbuffer callback has
type void *, without const:
typedef int (*ring_buffer_sample_fn)(void *ctx, void *data, size_t size);
However, if you actually try to write to this data, you'll get a SIGSEGV.
It seems to me the prototype should ideally be const void * so the
compiler can throw -Wdiscarded-qualifiers if someone tries to assign it
to a non-const type. I'm not sure there's anything to be done about it,
as changing it now would break the API. However, I wanted to mention it
just in case anyone has thoughts about this.
Thanks,
Martin