xref: /third_party/libbpf/include/linux/ring_buffer.h
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/libbpf/include/linux/
17c2aad20Sopenharmony_ci/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
27c2aad20Sopenharmony_ci#ifndef _TOOLS_LINUX_RING_BUFFER_H_
37c2aad20Sopenharmony_ci#define _TOOLS_LINUX_RING_BUFFER_H_
47c2aad20Sopenharmony_ci
57c2aad20Sopenharmony_ci#include <linux/compiler.h>
67c2aad20Sopenharmony_ci
77c2aad20Sopenharmony_cistatic inline __u64 ring_buffer_read_head(struct perf_event_mmap_page *base)
87c2aad20Sopenharmony_ci{
97c2aad20Sopenharmony_ci	return smp_load_acquire(&base->data_head);
107c2aad20Sopenharmony_ci}
117c2aad20Sopenharmony_ci
127c2aad20Sopenharmony_cistatic inline void ring_buffer_write_tail(struct perf_event_mmap_page *base,
137c2aad20Sopenharmony_ci					  __u64 tail)
147c2aad20Sopenharmony_ci{
157c2aad20Sopenharmony_ci	smp_store_release(&base->data_tail, tail);
167c2aad20Sopenharmony_ci}
177c2aad20Sopenharmony_ci
187c2aad20Sopenharmony_ci#endif /* _TOOLS_LINUX_RING_BUFFER_H_ */
19

Indexes created Thu Nov 07 10:32:03 CST 2024