Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5011495rdb; Tue, 12 Dec 2023 16:44:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBH5THn0WPSKvP8U37eLtv+Rr/huX6ZP1B7Hl9zkeBXSSSCgkNm0kAglNKrQ74+BbaQM9q X-Received: by 2002:a17:90a:9f45:b0:28a:93d:814c with SMTP id q5-20020a17090a9f4500b0028a093d814cmr5770104pjv.50.1702428257833; Tue, 12 Dec 2023 16:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702428257; cv=none; d=google.com; s=arc-20160816; b=kk5fQaofZAGaHZfZvD60GKI16ErkYabEsM0XdLHBL0KO6q7muVaIK/kam/1QEoA1S9 P9nvOQQO7sdT+Clk3YSjTp2f7AALUktwjJ6+AjnD/gFmruoXaxM/pwJpi0YIqoLOiTnz Y+KNl5jdGH33qkEOj8LN+ysVjFa3wv4yg2SXsOPm4kZoaEfr5ZMF8xq2V6wpvnWuqQ7p 8NjCkMgZ3Enx90KbGSfiNWd9T4mvhnjAKoRysO+rZ3qYx+QQ+7wVe2cluwKO8D2+QBNv nZOk+1QAH8FGONkWrNwNtaEqsytXE4/P2nv5W5lpKaDM77iSi0DiIjNLZEmQ/D0i8fIW HyMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=RD4JcZy4ThXtSoEV9jj94QNXJN2qP/DaMuwlZb6MEnE=; fh=2kYeZRERyy29Kt9H+h/5SWl+ZNAbDU5HA5KZ3dhEnPQ=; b=t9LtloXhCO45h0oahYDlDyfZpKj0nbhzx52/yPM5AZPAStYEtcjHqsD0ZTdTuGw6JQ dK2unSE8SXNEcU59MeQLrFOKo6c2/iGk7DTe9r+u80PnqJyfov9b+vi4ChK8+Kx6+hnA oKyIySGTdnh0/ICdIHUb+oLTuXYU8LWePGX8uNNhyBVUvmUM0QjA9tYotbIAe0ErH8y3 9G9znUUGCngglhyIssVewggeHlwjhwvRB0XE7i3IwNIX/RDEaUOzBH2ASzE6YuYj5dfC TLxFBovu3fKK92EvEAy5CX8U33VQ5ctZ4MxF8rC64fkP8Oyc71rbYJBlUg1O0Up05gNe Zf2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id x14-20020a17090a46ce00b002867eb143afsi9956990pjg.133.2023.12.12.16.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:44:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 75A4181CB0EE; Tue, 12 Dec 2023 16:44:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377870AbjLMAn4 (ORCPT + 99 others); Tue, 12 Dec 2023 19:43:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232683AbjLMAnz (ORCPT ); Tue, 12 Dec 2023 19:43:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36A8CAC for ; Tue, 12 Dec 2023 16:44:02 -0800 (PST) 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) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 16:44:15 -0800 (PST) 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