From: Steven Rostedt <rostedt@goodmis.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Ross Zwisler <zwisler@chromium.org>,
LKML <linux-kernel@vger.kernel.org>,
Ross Zwisler <zwisler@google.com>,
Andrii Nakryiko <andrii@kernel.org>,
linux-trace-kernel@vger.kernel.org,
Mykola Lysenko <mykolal@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
bpf <bpf@vger.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH 3/9] selftests/bpf: use canonical ftrace path
Date: Mon, 30 Jan 2023 18:34:19 -0500 [thread overview]
Message-ID: <20230130183419.0626dc21@gandalf.local.home> (raw)
In-Reply-To: <CAADnVQ+F3Z70mu3-QyyNFyJ2qCkDXnMJCW-o+fcnZo=LWj5d9g@mail.gmail.com>
On Mon, 30 Jan 2023 12:03:52 -0800
Alexei Starovoitov <alexei.starovoitov@gmail.com> 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
next prev parent reply other threads:[~2023-01-30 23:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 18:19 [PATCH 0/9] use canonical ftrace path whenever possible Ross Zwisler
2023-01-30 18:19 ` [PATCH 1/9] tracing: always use canonical ftrace path Ross Zwisler
2023-01-30 18:19 ` [PATCH 2/9] bpf: " Ross Zwisler
2023-01-30 18:19 ` [PATCH 3/9] selftests/bpf: " Ross Zwisler
2023-01-30 19:52 ` Alexei Starovoitov
2023-01-30 19:59 ` Steven Rostedt
2023-01-30 20:03 ` Alexei Starovoitov
2023-01-30 23:34 ` Steven Rostedt [this message]
2023-01-31 0:53 ` Alexei Starovoitov
2023-01-31 19:50 ` Steven Rostedt
2023-01-31 23:25 ` Alexei Starovoitov
2023-02-01 0:05 ` Ross Zwisler
2023-01-30 18:19 ` [PATCH 4/9] perf docs: " Ross Zwisler
2023-02-02 1:24 ` Arnaldo Carvalho de Melo
2023-01-30 18:19 ` [PATCH 5/9] tools/power: " Ross Zwisler
2023-02-02 14:47 ` Rafael J. Wysocki
2023-01-30 18:19 ` [PATCH 6/9] selftests: " Ross Zwisler
2023-01-30 18:19 ` [PATCH 7/9] tools/virtio: " Ross Zwisler
2023-01-30 19:26 ` Michael S. Tsirkin
2023-02-01 22:07 ` Ross Zwisler
2023-01-30 18:19 ` [PATCH 8/9] leaking_addresses: also skip " Ross Zwisler
2023-01-30 19:34 ` Tycho Andersen
2023-01-30 18:19 ` [PATCH 9/9] tools/kvm_stat: use " Ross Zwisler
2023-01-30 19:26 ` [PATCH 0/9] use canonical ftrace path whenever possible Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130183419.0626dc21@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yhs@fb.com \
--cc=zwisler@chromium.org \
--cc=zwisler@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).