]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ring-buffer: Check for empty ring-buffer with rb_num_of_entries()
authorVincent Donnefort <vdonnefort@google.com>
Wed, 8 Jan 2025 11:45:25 +0000 (11:45 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 13 Jan 2025 20:39:50 +0000 (15:39 -0500)
commit0568c6ebf072d913c437dbb5271f889a5e329007
treefa66bf50b14d305ec2e443cf0c6e1fcaff87b414
parent5bc55a333a2f7316b58edc7573e8e893f7acb532
ring-buffer: Check for empty ring-buffer with rb_num_of_entries()

Currently there are two ways of identifying an empty ring-buffer. One
relying on the current status of the commit / reader page
(rb_per_cpu_empty()) and the other on the write and read counters
(rb_num_of_entries() used in rb_get_reader_page()).

with rb_num_of_entries(). This intends to ease later
introduction of ring-buffer writers which are out of the kernel control
and with whom, the only information available is through the meta-page
counters.

Link: https://lore.kernel.org/20250108114536.627715-2-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c