File: ring_buffer.h

package info (click to toggle)
dwarves 1.30-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,884 kB
  • sloc: ansic: 153,757; python: 926; sh: 725; makefile: 191
file content (18 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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_ */