diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 08:24:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 08:24:23 +0000 |
commit | 67c27783d7735af6ba22b9f031d97ca4ea56c29c (patch) | |
tree | 17770fad3c90bf420cb2470e6e51255fcbf31bf9 /include/linux/ring_buffer.h | |
parent | Initial commit. (diff) | |
download | libbpf-67c27783d7735af6ba22b9f031d97ca4ea56c29c.tar.xz libbpf-67c27783d7735af6ba22b9f031d97ca4ea56c29c.zip |
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/linux/ring_buffer.h')
-rw-r--r-- | include/linux/ring_buffer.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h new file mode 100644 index 0000000..fc4677b --- /dev/null +++ b/include/linux/ring_buffer.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef _TOOLS_LINUX_RING_BUFFER_H_ +#define _TOOLS_LINUX_RING_BUFFER_H_ + +#include <linux/compiler.h> + +static inline __u64 ring_buffer_read_head(struct perf_event_mmap_page *base) +{ + return smp_load_acquire(&base->data_head); +} + +static inline void ring_buffer_write_tail(struct perf_event_mmap_page *base, + __u64 tail) +{ + smp_store_release(&base->data_tail, tail); +} + +#endif /* _TOOLS_LINUX_RING_BUFFER_H_ */ |