]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ring-buffer: Report header_page overwrite as char
authorCao Ruichuang <create0818@163.com>
Mon, 6 Apr 2026 16:53:33 +0000 (00:53 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 14 Apr 2026 08:29:55 +0000 (04:29 -0400)
The header_page tracefs metadata currently reports overwrite as an
int field with size 1. That makes parsers warn about a type and
size mismatch even though the field is only used as a one-byte flag
within commit.

Keep the shared offset with commit as-is, but report overwrite as
char so the declared type matches the hardcoded size. The signedness
is already carried separately by the emitted signed field.

Link: https://patch.msgid.link/20260406165333.46052-1-create0818@163.com
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216999
Signed-off-by: Cao Ruichuang <create0818@163.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c

index 2caa5d3d0ae984194db8f778ec04c3e3af579b8e..839a6424d0edc1c9abfcb7501050cb03d263a146 100644 (file)
@@ -597,11 +597,11 @@ int ring_buffer_print_page_header(struct trace_buffer *buffer, struct trace_seq
                         (unsigned int)sizeof(field.commit),
                         (unsigned int)is_signed_type(long));
 
-       trace_seq_printf(s, "\tfield: int overwrite;\t"
+       trace_seq_printf(s, "\tfield: char overwrite;\t"
                         "offset:%u;\tsize:%u;\tsigned:%u;\n",
                         (unsigned int)offsetof(typeof(field), commit),
                         1,
-                        (unsigned int)is_signed_type(long));
+                        (unsigned int)is_signed_type(char));
 
        trace_seq_printf(s, "\tfield: char data;\t"
                         "offset:%u;\tsize:%u;\tsigned:%u;\n",