Re: [PATCH v1] ring-buffer: Rename ring_buffer_size() to ring_buffer_capacity()
From: sashiko-bot@kernel.org
Date: 2026-09-07 09:51:07
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Typo in the newly added docstring for ring_buffer_capacity(). -- commit 0916229b26fe9d5e8fd8143432df2554e399aa85 Author: Vincent Donnefort [off-list ref] ring-buffer: Rename ring_buffer_size() to ring_buffer_capacity() "capacity" refers to the memory available for events while "size" refers to the raw allocation. ring_buffer_size() actually calculates event capacity, so rename it to ring_buffer_capacity() to match this convention.
quoted hunk ↗ jump to hunk
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 9c03a555a6ba2..2940ff7633542 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -6547,18 +6547,23 @@ void ring_buffer_iter_advance(struct ring_buffer_iter *iter) EXPORT_SYMBOL_GPL(ring_buffer_iter_advance); /** - * ring_buffer_size - return the size of the ring buffer (in bytes) + * ring_buffer_capacity - return the capacity of the ring buffer (in bytes) * @buffer: The ring buffer. - * @cpu: The CPU to get ring buffer size from. + * @cpu: The CPU to get ring buffer capacity from. + * + * Capacity is the total memory available for recording event data in the + * ring buffer. It excludes subbufer headers.
[Severity: Low] This isn't a bug, but there is a typo here (subbufer instead of subbuffer).
+ * + * Returns the capacity in bytes, or 0 if the CPU is not set in the buffer mask. */ -unsigned long ring_buffer_size(struct trace_buffer *buffer, int cpu) +unsigned long ring_buffer_capacity(struct trace_buffer *buffer, int cpu)
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260907094238.3624013-1-vdonnefort@google.com?part=1