* [PATCH] ring-buffer: fix kernel-doc format to avoid a warning
@ 2025-10-17 7:07 Randy Dunlap
2025-10-17 9:08 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2025-10-17 7:07 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Lai Jiangshan, Steven Rostedt, Masami Hiramatsu,
Mathieu Desnoyers, linux-trace-kernel
Format the kernel-doc for RINGBUF_TYPE_DATA_TYPE_LEN_MAX correctly
to prevent a kernel-doc warning:
Warning: include/linux/ring_buffer.h:61 Enum value
'RINGBUF_TYPE_DATA_TYPE_LEN_MAX' not described in enum 'ring_buffer_type'
Fixes: 334d4169a659 ("ring_buffer: compressed event header")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: linux-trace-kernel@vger.kernel.org
---
include/linux/ring_buffer.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-next-20251016.orig/include/linux/ring_buffer.h
+++ linux-next-20251016/include/linux/ring_buffer.h
@@ -43,7 +43,7 @@ struct ring_buffer_event {
* array[0] = top (28 .. 59) bits
* size = 8 bytes
*
- * <= @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
+ * @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
* Data record
* If type_len is zero:
* array[0] holds the actual length
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ring-buffer: fix kernel-doc format to avoid a warning
2025-10-17 7:07 [PATCH] ring-buffer: fix kernel-doc format to avoid a warning Randy Dunlap
@ 2025-10-17 9:08 ` Steven Rostedt
2025-10-17 19:11 ` Randy Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2025-10-17 9:08 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, Lai Jiangshan, Masami Hiramatsu, Mathieu Desnoyers,
linux-trace-kernel
On Fri, 17 Oct 2025 00:07:53 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:
> Format the kernel-doc for RINGBUF_TYPE_DATA_TYPE_LEN_MAX correctly
> to prevent a kernel-doc warning:
>
> Warning: include/linux/ring_buffer.h:61 Enum value
> 'RINGBUF_TYPE_DATA_TYPE_LEN_MAX' not described in enum 'ring_buffer_type'
Then this needs to be updated differently, because that "<=" is stating
what happens when the value is <= RINGBUF_TYPE_DATA_TYPE_LEN_MAX.
It wasn't random characters.
Basically, the enum describes the event type.
enum ring_buffer_type {
RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28,
RINGBUF_TYPE_PADDING,
RINGBUF_TYPE_TIME_EXTEND,
RINGBUF_TYPE_TIME_STAMP,
};
When the type is > 28 it is either a padding, time-extend or
time-stamp. But if it is less than or equal to
RINGBUF_TYPE_DATA_TYPE_LEN_MAX then it is the length of a data event.
Perhaps we should have it be:
* 0:
* Data record
* array[0] holds the actual length
* array[1..(length+3)/4] holds data
* size = 4 + length (bytes)
*
* 1 - @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
* Data record
* length = type_len << 2
* array[0..(length+3)/4-1] holds data
* size = 4 + length (bytes)
?
This data is more important that making kerneldoc work.
-- Steve
>
> Fixes: 334d4169a659 ("ring_buffer: compressed event header")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> ---
> Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: linux-trace-kernel@vger.kernel.org
> ---
> include/linux/ring_buffer.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20251016.orig/include/linux/ring_buffer.h
> +++ linux-next-20251016/include/linux/ring_buffer.h
> @@ -43,7 +43,7 @@ struct ring_buffer_event {
> * array[0] = top (28 .. 59) bits
> * size = 8 bytes
> *
> - * <= @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
> + * @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
> * Data record
> * If type_len is zero:
> * array[0] holds the actual length
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ring-buffer: fix kernel-doc format to avoid a warning
2025-10-17 9:08 ` Steven Rostedt
@ 2025-10-17 19:11 ` Randy Dunlap
0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2025-10-17 19:11 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, Lai Jiangshan, Masami Hiramatsu, Mathieu Desnoyers,
linux-trace-kernel
On 10/17/25 2:08 AM, Steven Rostedt wrote:
> On Fri, 17 Oct 2025 00:07:53 -0700
> Randy Dunlap <rdunlap@infradead.org> wrote:
>
>> Format the kernel-doc for RINGBUF_TYPE_DATA_TYPE_LEN_MAX correctly
>> to prevent a kernel-doc warning:
>>
>> Warning: include/linux/ring_buffer.h:61 Enum value
>> 'RINGBUF_TYPE_DATA_TYPE_LEN_MAX' not described in enum 'ring_buffer_type'
>
> Then this needs to be updated differently, because that "<=" is stating
> what happens when the value is <= RINGBUF_TYPE_DATA_TYPE_LEN_MAX.
>
> It wasn't random characters.
>
> Basically, the enum describes the event type.
>
> enum ring_buffer_type {
> RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28,
> RINGBUF_TYPE_PADDING,
> RINGBUF_TYPE_TIME_EXTEND,
> RINGBUF_TYPE_TIME_STAMP,
> };
>
> When the type is > 28 it is either a padding, time-extend or
> time-stamp. But if it is less than or equal to
> RINGBUF_TYPE_DATA_TYPE_LEN_MAX then it is the length of a data event.
>
> Perhaps we should have it be:
>
> * 0:
> * Data record
> * array[0] holds the actual length
> * array[1..(length+3)/4] holds data
> * size = 4 + length (bytes)
> *
> * 1 - @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
> * Data record
> * length = type_len << 2
> * array[0..(length+3)/4-1] holds data
> * size = 4 + length (bytes)
>
> ?
>
> This data is more important that making kerneldoc work.
For sure it is. Thanks for the explanation.
I'll see if I can come up with an alternative - or not.
>
>
>>
>> Fixes: 334d4169a659 ("ring_buffer: compressed event header")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> ---
>> Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>> Cc: Masami Hiramatsu <mhiramat@kernel.org>
>> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>> Cc: linux-trace-kernel@vger.kernel.org
>> ---
>> include/linux/ring_buffer.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- linux-next-20251016.orig/include/linux/ring_buffer.h
>> +++ linux-next-20251016/include/linux/ring_buffer.h
>> @@ -43,7 +43,7 @@ struct ring_buffer_event {
>> * array[0] = top (28 .. 59) bits
>> * size = 8 bytes
>> *
>> - * <= @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
>> + * @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
>> * Data record
>> * If type_len is zero:
>> * array[0] holds the actual length
>
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-17 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 7:07 [PATCH] ring-buffer: fix kernel-doc format to avoid a warning Randy Dunlap
2025-10-17 9:08 ` Steven Rostedt
2025-10-17 19:11 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).