From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 533BFEB8; Wed, 13 Dec 2023 00:44:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04D94C433C8; Wed, 13 Dec 2023 00:43:58 +0000 (UTC) Date: Tue, 12 Dec 2023 19:44:41 -0500 From: Steven Rostedt To: Alexander Graf Cc: , , , , , , , , Eric Biederman , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Rob Herring , Andrew Morton , Mark Rutland , Tom Lendacky , Ashish Kalra , James Gowans , "Stanislav Kinsburskii" , , , , Anthony Yznaga , Usama Arif , "David Woodhouse" , Benjamin Herrenschmidt Subject: Re: [PATCH 08/15] tracing: Introduce names for ring buffers Message-ID: <20231212194441.2701c48b@gandalf.local.home> In-Reply-To: References: <20231213000452.88295-1-graf@amazon.com> <20231213000452.88295-9-graf@amazon.com> <20231212191546.603c0703@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 13 Dec 2023 01:35:16 +0100 Alexander Graf wrote: > > 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