Thread (29 messages) 29 messages, 5 authors, 2023-12-18

Re: [PATCH 08/15] tracing: Introduce names for ring buffers

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2023-12-13 00:44:04
Also in: kexec, linux-arm-kernel, linux-devicetree, linux-doc, linux-mm, lkml

On Wed, 13 Dec 2023 01:35:16 +0100
Alexander Graf [off-list ref] wrote:
quoted
The trace_array is the structure that represents each tracing instance. And
it already has a name field. And if you can get the associated ring buffer
from that too.

struct trace_array *tr;

         tr->array_buffer.buffer

         tr->name

When you do: mkdir /sys/kernel/tracing/instance/foo

You create a new trace_array instance where tr->name = "foo" and allocates
the buffer for it as well.  
The name in the ring buffer is pretty much just a copy of the trace 
array name. I use it to reconstruct which buffer we're actually 
referring to inside __ring_buffer_alloc().
No, I rather not tie the ring buffer to the trace_array.
I'm all ears for alternative suggestions. I suppose we could pass tr as 
argument to ring_buffer_alloc() instead of the name?
I'll have to spend some time (that I don't currently have :-( ) on looking
at this more. I really don't like the copying of the name into the ring
buffer allocation, as it may be an unneeded burden to maintain, not to
mention the duplicate field.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help