Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6871621rdb; Fri, 15 Dec 2023 10:25:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPixf5YaeaN2e0x07nmLNHIzb3JKR7px+HPt44qbNXivodE/9Sxk38N/nbS8Pp4olFOt5z X-Received: by 2002:a17:90b:1e46:b0:286:6cc0:885f with SMTP id pi6-20020a17090b1e4600b002866cc0885fmr5530264pjb.76.1702664729930; Fri, 15 Dec 2023 10:25:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702664729; cv=none; d=google.com; s=arc-20160816; b=oYwePRVzGU6peb7eXK0m56SYgDhr55btSAB9STs/J5uIQlSAClbLHe1VMc+6uX5XKh cjkA4DN49z9U4kHL1rMDLlmDta87vbQ8dxR1p7UkTfpX+8vWO0+FN2qoyB6tTLt2AaPS WZW9skbrwERNq28s/Txhp0dJrTJg/pJvCnFYAxjF5KB1GVoP4S9U/1jsrkc8YqKm2lw1 twqUAqKH9SxeTTW9h6aCo8F1zLKrn3FTtN7Vk2SHm/3WWefDK3tEP/QaqpmKfcn1MfqA FNN/Bn/a1MBqlPLUcJJHOLtLI6nlrjr2HhE2HP/Vvw8SyjVRy5WJ75wqJNVomcQMVCFa IUSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bSNqmLrCyu7auO76N1WM90hXjk9trz87LmhaBCIsgfw=; fh=6+dHPNKjdDTOa3r4J0IsgUv5o+9uG7i49KP+T0YP/bs=; b=xQakG+iabfe1ulOXWX/DxS5FHobCoo/sHabvkg2y9hoVmF3WBS/gSWY+MVgH3jOvN6 lRqjcUMVUR2VpmRVV9liSUF+W4fgqx6fn0wWxY5+G7JDLBt5lmwTI3Y4fFpMX4mvEq/f ODIl2mBwwIxPCUPcWAO2aPQJ2IGDUgB2VVJAFuccSjyuknQZhkCBwyDzr49Vf4OE5pWw GGV7EFrcu/KsxX/RJRZKunPmif9qe2uKsxBjC67kCNRMNFUdggE/YlJvgALeJkPUX6ou 4nLG0tBp10RaFAl83HbCNLfOEACoP7Uqu7eFWXkjnjvsjsKeLbpKi/QPkhL/2GhBfl/l /qMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=xNPEa4WB; spf=pass (google.com: domain of linux-kernel+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2-20020a17090ad98200b0028b2c173b18si144440pjv.3.2023.12.15.10.25.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 10:25:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=xNPEa4WB; spf=pass (google.com: domain of linux-kernel+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8E0742815D2 for ; Fri, 15 Dec 2023 18:25:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 527853FB34; Fri, 15 Dec 2023 18:25:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="xNPEa4WB" X-Original-To: linux-kernel@vger.kernel.org Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (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 F22E03FB1A; Fri, 15 Dec 2023 18:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1702664707; bh=8pPkSg7S8q66WlYRj2KvGV3oLWL1XOnV3HYHrzVW4Kk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=xNPEa4WB8PBvgLT8QYmtc303UO/pA+OM68GS4Fa8SAbRhp7LHDeemUkWWwEA2kSUw jG9n8DRjlKIH+5gFnxIEqFhKPyR8ikJjhwC/CekPVcRmwAtXQeuvIFvP0bgEafsyPy V9UI6RW3IhzZ13dsEvVKaJNXfRkqck+gIuTWTXe87ooikzVSWd+dCWj+0IDmp8KRsE feXgwP/gCibF12nhej6EFS9oubZVd0VYluL05PbEHsjynzvZlBmRHC4P/QRbMBr6pd Us0BGQZtYKh5MCHQh9nCtgnU1Jd95ZNo8tdteuXajYNR7CPeglR2u6MVnvmk7rYkHg agtrgeDd1sT8Q== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4SsHh35CVQzH3B; Fri, 15 Dec 2023 13:25:07 -0500 (EST) Message-ID: Date: Fri, 15 Dec 2023 13:25:07 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tracing: Add disable-filter-buf option Content-Language: en-US To: Steven Rostedt Cc: LKML , Linux trace kernel , Masami Hiramatsu , Mark Rutland References: <20231215102633.7a24cb77@rorschach.local.home> <21936075-3858-446a-9391-a38e8d8968e7@efficios.com> <20231215120417.567d5ea4@rorschach.local.home> <20231215123458.63f57238@rorschach.local.home> From: Mathieu Desnoyers In-Reply-To: <20231215123458.63f57238@rorschach.local.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-12-15 12:34, Steven Rostedt wrote: > On Fri, 15 Dec 2023 12:24:14 -0500 > Mathieu Desnoyers wrote: > >> On 2023-12-15 12:04, Steven Rostedt wrote: >>> On Fri, 15 Dec 2023 10:53:39 -0500 >>> Mathieu Desnoyers wrote: >> [...] >>>> >>>> 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. >> >> I'll be clearer then: I think this is a bad ABI. In your reply, you justify >> this bad ABI by implementation motivations. > > What's wrong with a way to stop the copying ? I am not against exposing an ABI that allows userspace to alter the filter behavior. I disagree on the way you plan to expose the ABI. Exposing this option as an ABI in this way exposes too much internal ring buffer implementation details to userspace. It exposes the following details which IMHO should be hidden or configurable in a way that allows moving to a whole new mechanism which will have significantly different characteristics in the future: It exposes that: - filtering uses a copy to a temporary buffer, and - that this copy is enabled by default. Once exposed, those design constraints become immutable due to ABI. > > The option is just a way to say "I don't want to do the copy into the > buffer, I want to go directly into it" My main concern is how this concept, once exposed to userspace, becomes not only an internal implementation detail, but a fundamental part of the design which cannot ever go away without breaking the ABI or making parts of the ABI irrelevant. I can make a parallel with the scheduler: this is as if the sched feature knobs (which are there only for development/debugging purposes) would all be exposed as userspace ABI. This would seriously limit the evolution of the scheduler design in the future. I see this as the same problem at the ring buffer level. > >> >> I don't care about the implementation, I care about the ABI, and >> I feel that your reply is not addressing my concern at all. > > Maybe I don't understand your concern. > > It's an on/off switch (like all options are). This is just a way to say > "I want to indirect copying of the event before filtering or not". Not all tracefs options are booleans. The "current_tracer" file ABI exposes a string input/output parameter. I would recommend the same for the equivalent of a "current_filter" file. > > The "input-argument" part above may never happen. What's different > between tracefs and LTTng, is that all events are created by the > subsystem not by me. You don't use the TRACE_EVENT() macro, but you > need to manually create each event you care about yourself. It's more > of a burden but you also then have the luxury of hooking to the input > portion. That is not exposed, and that is by design. As that could > possibly make all tracepoints an ABI, and you'll have people like > peterz nacking any new tracepoint in the scheduler. He doesn't allow > trace events anymore because of that exposure. I'm not arguing for moving to the input-argument scheme, I just used this as an hypothetical example to show why we should not expose internal implementation details to userspace which will prevent future evolution only for the sake of having debugging knobs. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com