Re: [PATCH] tracing: move buffer in trace_seq to end of struct

From: Steven Rostedt
Date: Tue Sep 02 2025 - 16:00:48 EST


On Thu, 21 Aug 2025 11:32:17 -0700
Elijah <me@elijahs.space> wrote:

> can we maybe encode the overflow state in seq_buf? check if
> seq_buf_has_overflowed and clamp len back to the used size
> (seq_buf_used) in a helper?

I could add a bit to the size?

diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
index 52791e070506..ea4996851901 100644
--- a/include/linux/seq_buf.h
+++ b/include/linux/seq_buf.h
@@ -20,8 +20,9 @@
*/
struct seq_buf {
char *buffer;
- size_t size;
- size_t len;
+ unsigned int size;
+ unsigned int len:31;
+ unsigned int full:1;
};

#define DECLARE_SEQ_BUF(NAME, SIZE) \


-- Steve