Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6817713rdb; Fri, 15 Dec 2023 09:04:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEA/xJVh50tx37rZL51m0d9KWKlXcb62b1KyZp3UNQPZMjHldeAacL3HOcYNAF67XwTTVp8 X-Received: by 2002:a50:cc49:0:b0:54c:87a1:34fe with SMTP id n9-20020a50cc49000000b0054c87a134femr7108074edi.10.1702659868908; Fri, 15 Dec 2023 09:04:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702659868; cv=none; d=google.com; s=arc-20160816; b=HGoiN/X8BDF+KCZUT+2ic/F7Mu6F0Br4GWNesBTVZHNH7w5XjF5rKAQqE8UAnIpvhG kkkQ1BZ8/kCjVW5h7V8J9jIgYoY5aGtMd7tugw1VnR79Sz55sC8PjqVG9dRCCXfYMYZL zAlEPiU96FQ8okIerv+6Ip6tQAjYGaueMACRBt2eNo39rvb7vaHEi3AVSPGhGC+oIyN1 IUUS4bRMlpTD3f2sEb3qAoMf/K5vzddw+gIB9jEQ66H2mJJjkVVPkSEK7Bu3oqUo7Lai Plnat8pvRxeEkRMeTjq/xA2z05W7Z2tYsunBzFRaurpioXXsD+fEwAX7ysoPslScn7gx oD2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=SX45KmZdm93s1fyAUrFfOwUo6ifLZhXzj6NsVCf+V9w=; fh=UZpTDzkhzZ9L8G7jwsdcfgvh6xD2n8fD+pbOm7SKsOE=; b=Yyxo5TgwzbeDeyAs4LAG8fg5IhW/erRLZvWwzcm18Xt/cm+8lDrrkUUTucebHwEwMX SlOAvSWSNPxRXzjUkj5NNewMusdc1dqm4q1U1R7tzN+OTeOHIQn17QQzpACNmTNny3yj efUS4zZw1MgrlmDLgU/b8ulMouC3ptZlfa2AUZHewbMvs4GV36rYbiO+gGCQzsA+H32s 9vMNYReR91bF0TLW+dg75pUZDdwAPLzFZLq9ZKszUUWmLm/5U/rvsXDjbWf9OeBl2GnZ wigmqXLX1YIhJe+gdsF401Mu5p4JOBu28ocbDM2FcLL7OkOcQS4YrRolN3k9uK4dawYU emlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cb17-20020a0564020b7100b005529bea1d26si1023343edb.592.2023.12.15.09.04.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 09:04:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A13431F2524E for ; Fri, 15 Dec 2023 17:04:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A2F33EA90; Fri, 15 Dec 2023 17:04:21 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 934433EA78; Fri, 15 Dec 2023 17:04:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3050C433C8; Fri, 15 Dec 2023 17:04:19 +0000 (UTC) Date: Fri, 15 Dec 2023 12:04:17 -0500 From: Steven Rostedt To: Mathieu Desnoyers Cc: LKML , Linux trace kernel , Masami Hiramatsu , Mark Rutland Subject: Re: [PATCH] tracing: Add disable-filter-buf option Message-ID: <20231215120417.567d5ea4@rorschach.local.home> In-Reply-To: <21936075-3858-446a-9391-a38e8d8968e7@efficios.com> References: <20231215102633.7a24cb77@rorschach.local.home> <21936075-3858-446a-9391-a38e8d8968e7@efficios.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-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 Fri, 15 Dec 2023 10:53:39 -0500 Mathieu Desnoyers wrote: > > > I'm not convinced that a boolean state is what you need here. I will admit the biggest motivation for this was to allow for debugging ;-) > > Yes, today you are in a position where you have two options: > > a) use the filter buffer, which falls back on copy to ring buffer > if nested, > > b) disable the filter buffer, and thus always copy to ring buffer > before filtering, > > But I think it would not be far-fetched to improve the implementation > of the filter-buffer to have one filter-buffer per nesting level > (per execution context), or just implement the filter buffer as a > per-cpu stack, which would remove the need to fall back on copy > to ring buffer when nested. Or you could even do like LTTng and > filter on the input arguments directly. The filtering on the input arguments is much more difficult as they are not exposed to user space. I plan on adding that feature, but it will be more tied to the probe infrastructure, and be separate from this type of filtering. When looking at removing the discard, I found that the histogram logic currently depends on writing to the ring buffer directly. That's because it needs to know the timestamp, and may or may not discard it. I'll have to look at this code more and see if I can get rid of that. In fact, this patch taps into that logic (it's what added the tracing_set_filter_buffering() function. > > But each of these changes would add yet another boolean tunable, > which can quickly make the mix hard to understand from a user > perspective. Honestly, if I do the stack filtering (it's already per_cpu), it will replace this altogether, and this option will still be available. That is, it will switch off buffering an event regardless of the implementation. > > So rather than stacking tons of "on/off" switches for filter > features, how about you let users express the mechanism they > want to use for filtering with a string instead ? e.g. > > filter-method="temp-buffer" > filter-method="ring-buffer" > filter-method="input-arguments" If I add other ways to filter, it will be a separate file to control that, but all options are on/off switches. Even if I add other functionality to the way buffers are created, this will still have the same functionality to turn the entire thing on or off. Thanks for the review. -- Steve