On 6/2/26 6:00 AM, Steven Rostedt wrote:
On Mon, 1 Jun 2026 16:24:43 -0700
Manjunath Patil <[email protected]> wrote:
Ftrace keeps trace arrays at a boot-minimum ring-buffer size until
tracing is used. Tracefs event-enable paths already call
tracing_update_buffers() before enabling events, but the exported
in-kernel helpers trace_set_clr_event() and trace_array_set_clr_event()
directly enable events through __ftrace_set_clr_event().
This can leave events enabled by in-kernel users recording into the tiny
boot-minimum buffer instead of the configured default-sized buffer. Any
caller that enables events through these exported helpers observes
different buffer-expansion behavior than a userspace tracefs event enable.
Expand the relevant trace array before enabling events through the
exported in-kernel helpers, matching the tracefs event-enable behavior.
Disabling events remains unchanged.
The above explains everything correctly, but you left out what needs this?
Internal code should not be using the main ring buffer except for
debugging, in which case you can use trace_printk(), which will cause the
tracing buffers to be expanded by default.
Other areas of the kernel should create their own trace array which will be
created expanded by default too.
-- Steve
Thanks Steve, that makes sense.
The concrete case I was trying to address is not an upstream in-tree
user. It is a downstream UEK RDS compatibility path where the legacy
rds_rt_debug_bitmap module parameter is mapped to RDS
tracepoints by calling trace_set_clr_event() against the global trace
array during module init. That can leave the default RDS tracepoints
recording into the boot-minimum buffer unless userspace expands tracing
first.
Looking at mainline again, trace-array users are already created
expanded by default, and the remaining global-buffer use is
debugging-style. So I agree this generic tracing/events change does not
have a good upstream justification.
Please drop this patch. We will handle the downstream RDS compatibility
case downstream, or move it to an explicit userspace/trace-array setup.
Thanks,
Manjunath