| Given libbpf is a generic library and not restricted to x86-64 only, the compiler barrier in bpf_perf_event_read_simple() after fetching the head needs to be replaced with smp_rmb() at minimum. Also, writing out the tail we should use WRITE_ONCE() to avoid store tearing. Now that we have the logic in place in ring_buffer_read_head() and ring_buffer_write_tail() helper also used by perf tool which would select the correct and best variant for a given architecture (e.g. x86-64 can avoid CPU barriers entirely), make use of these in order to fix bpf_perf_event_read_simple(). Fixes: | ||
|---|---|---|
| .. | ||
| api | ||
| bpf | ||
| lockdep | ||
| subcmd | ||
| symbol | ||
| traceevent | ||
| bitmap.c | ||
| find_bit.c | ||
| hweight.c | ||
| rbtree.c | ||
| str_error_r.c | ||
| string.c | ||
| vsprintf.c | ||