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?

On 8/21/2025 8:53 AM, Steven Rostedt wrote:
On Thu, 21 Aug 2025 11:43:55 -0400
Steven Rostedt <[email protected]> wrote:

diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
index a93ed5ac3226..92364deb39a5 100644
--- a/include/linux/trace_seq.h
+++ b/include/linux/trace_seq.h
@@ -24,14 +24,12 @@ struct trace_seq {
        char                    buffer[TRACE_SEQ_BUFFER_SIZE];
        struct seq_buf          seq;
        size_t                  readpos;
-       int                     full;
  };

I should have tried compiling it before posting. But trace.c has this:

                ret = print_trace_line(iter);
                if (ret == TRACE_TYPE_PARTIAL_LINE) {
                        iter->seq.full = 0;
                        trace_seq_puts(&iter->seq, "[LINE TOO BIG]\n");
                }

I need to figure out a clean way to fix that too :-p

-- Steve


Reply via email to