mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-11 14:16:24 +08:00
Deploying to gh-pages from @ eunomia-bpf/bpf-developer-tutorial@ab0d1eef08 🚀
This commit is contained in:
18
third_party/libbpf/include/linux/ring_buffer.h
vendored
Normal file
18
third_party/libbpf/include/linux/ring_buffer.h
vendored
Normal file
@@ -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_ */
|
||||
Reference in New Issue
Block a user