Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36EDCC636D7 for ; Mon, 30 Jan 2023 23:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbjA3Xea (ORCPT ); Mon, 30 Jan 2023 18:34:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjA3Xe2 (ORCPT ); Mon, 30 Jan 2023 18:34:28 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 207813AA2; Mon, 30 Jan 2023 15:34:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8E73ECE1331; Mon, 30 Jan 2023 23:34:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3544C433D2; Mon, 30 Jan 2023 23:34:21 +0000 (UTC) Date: Mon, 30 Jan 2023 18:34:19 -0500 From: Steven Rostedt To: Alexei Starovoitov Cc: Ross Zwisler , LKML , Ross Zwisler , Andrii Nakryiko , linux-trace-kernel@vger.kernel.org, Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , bpf , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH 3/9] selftests/bpf: use canonical ftrace path Message-ID: <20230130183419.0626dc21@gandalf.local.home> In-Reply-To: References: <20230130181915.1113313-1-zwisler@google.com> <20230130181915.1113313-4-zwisler@google.com> <20230130145932.37cf6b73@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Jan 2023 12:03:52 -0800 Alexei Starovoitov wrote: > > > > > > So this change will break the tests. We cannot do it. > > > > Could we add a way to try to mount it? > > > > If anything, the tests should not have the path hard coded. It should then > > look to see if it is mounted and use the path that is found. Otherwise it > > should try mounting it at the correct location. > > > > Feel free to take the code from libtracefs (and modify it): > > > > https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/tree/src/tracefs-utils.c#n89 > > > > It will make the test code much more robust. > > The point is not about tests. The point is that this change might break > some users that are working today with /sys/kernel/debug/tracing. > It also might be mounted differently. > For example from another system: > cat /proc/mounts|grep trace > tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0 > tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0 Yes, and the code works when it's mounted multiple times. > > So I suggest leaving the code as-is. Why? I want to make /sys/kernel/debug/tracing deprecated. It's a hack to not break old code. I've had complaints about that hack, and there's even systems that disable the auto mounting (that is, /sys/kernel/debug/tracing would not exist in such configs) This was never expected to be a permanent solution. If anything, leaving hardcoded calls like that forces the user to mount debugfs when they may not want to. The entire point of tracefs was to allow users to have access to the trace events without having to expose debugfs and all the crud it brings with it. This was requested several times before it was added. What is your technical reason for not modifying the code to look for tracefs in /sys/kernel/tracing and if it's not there try /sys/kernel/debug/tracing, and if both are not found, try mounting it. That change is not hard and makes the code much more robust and does not break anything. -- Steve