Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3447508rdh; Mon, 27 Nov 2023 14:50:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjkGRQmdExYANR0Gap2Nl68x9qqNSPFkQXITOo28m55K5zyJ3cRXiNQD0XMWk+8EuIQ5It X-Received: by 2002:a05:6a20:daa5:b0:18b:e5e6:576c with SMTP id iy37-20020a056a20daa500b0018be5e6576cmr19974732pzb.3.1701125416489; Mon, 27 Nov 2023 14:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701125416; cv=none; d=google.com; s=arc-20160816; b=cc5xH/PtixUcKAd5k8z2n6LWIQaAILGmqw5aX1rR3febDIjPmVwwZRKJeHEt86Gb27 yW+Q1Y1rakQomcH3XUGCe9f56nzXNoAnVGFQzscrI9/0/D6i0ay6oH+6919odNEu2ZTF orzogavB08ATXFVt9rHxVbQa+WiQK9VulANUmq4oOX3mbQy12y2k4Gl5hca5juqzYu3d qqUL5sapQ+Po3ePPDxur+/wQ9TDqJL8XJribIZn5gkSUV092Zw9y7rGD23Jx/Bdm9nl1 4AXFnQZSt5ArD0rB21aeYU8A9q8VI88gt1Z/+9hnU29nnfBC49nnS8Hh50UFYEyvyI3i xrcg== 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=plSuPKdowGUlmQbLj657Mx8SQuY6wRLp2xHQpk3+/m0=; fh=2dQ+jP14JIALf+0QaW8wSB+3/FS0GCMlJeZ19DI35vQ=; b=NRItrK6S+T9WH+ZDLBzacLt/yufcVbiLn6gVGSngH+GhUFBplJ8OGi8e2scKMDvaTO DREA+vSnCNDYTBpYWcxQ6M3gFded1zkC8RwbUZN6Zo8PIWwC6Ey4zY+fQ1hsu0AMZMuV OTLIzgklOhy+r4zBk4XjMpk4q7sv0LIyj/IWEDmivL1xrcUxtyE1yKnGPAgkr0K9FQL2 4KVQdXwdAq4gJlJmFQRqhg2ssLGAmJmILn3MlNEWJIs68OVTel1CzKhjV0urGQ1RRrWx usQPXFehrKIhBuiZiXJBqLXZO7MnX3LH+Lyb7ucOpkdthjDQqtONxjgCtEGZ76foAfSy zWuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bi6-20020a056a02024600b005c2203bfc01si12379619pgb.170.2023.11.27.14.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 14:50:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id B63CE806AA3F; Mon, 27 Nov 2023 14:50:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231693AbjK0Wt5 (ORCPT + 99 others); Mon, 27 Nov 2023 17:49:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjK0Wt4 (ORCPT ); Mon, 27 Nov 2023 17:49:56 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD43192 for ; Mon, 27 Nov 2023 14:50:02 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9B4FC433C7; Mon, 27 Nov 2023 22:50:00 +0000 (UTC) Date: Mon, 27 Nov 2023 17:50:21 -0500 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , dmaluka@google.com, Sean Paul , Arun Easi , Daniel Wagner Subject: Re: [RFC][PATCH] tracing: Allow creating instances with specified system events Message-ID: <20231127175021.0c0edc53@gandalf.local.home> In-Reply-To: <20231127174108.3c331c9c@gandalf.local.home> References: <20231127174108.3c331c9c@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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 27 Nov 2023 14:50:14 -0800 (PST) On Mon, 27 Nov 2023 17:41:08 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > A trace instance may only need to enable specific events. As the eventfs > directory of an instance currently creates all events which adds overhead, > allow internal instances to be created with just the events in systems > that they care about. This currently only deals with systems and not > individual events, but this should bring down the overhead of creating > instances for specific use cases quite bit. This change log is not very good. I didn't actually state what was done :-p Anyway, function trace_array_get_by_name() has an added parameter "systems" (and I forgot to update its kerneldoc). This parameter is a string of comma, or space, or commas and spaces deliminators of event system names. If it's not NULL, then it will only create the event system directories of those event systems that match the systems parameter. That is: trace_array_get_by_name("qla2xxx", "qla"); Will create an instance called "qla2xxx" and only have "qla" system events in it. Note, trace_array_printk() will still write into this instance, and it can be read via trace-cmd with no problems. -- Steve > > The qla2xxx instance could just enable the systems it cares about, but that > should be a separate patch. > > Note that kprobes and synthetic events created after the creation of these > instances, will be added to these instances, but those that are created > before the creation of the instance will not be included. > > Note, this may also be useful for creating instances in the eventfs, but > I'm not sure how to do this there. I could add a deliminator: > > mkdir /sys/kernel/tracing/instances/foo::sched,timer > > But if a tool already uses "::" as a deliminator, then this will break it. > I could just have it work if all the events after the deliminator exist. > > Thoughts? > > Signed-off-by: Steven Rostedt (Google) > --- > drivers/scsi/qla2xxx/qla_os.c | 2 +- > include/linux/trace.h | 4 ++-- > kernel/trace/trace.c | 22 ++++++++++++-------- > kernel/trace/trace.h | 3 ++- > kernel/trace/trace_boot.c | 2 +- > kernel/trace/trace_events.c | 31 ++++++++++++++++++++++++++--- > samples/ftrace/sample-trace-array.c | 2 +- > 7 files changed, 49 insertions(+), 17 deletions(-)