Re: [RFC][PATCH] tracing: Deprecate auto-mounting tracefs in debugfs
From: Ian Rogers
Date: Tue Jun 17 2025 - 14:49:23 EST
On Tue, Jun 17, 2025 at 11:00 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Tue, Jun 17, 2025 at 01:54:46PM -0400, Steven Rostedt wrote:
> >
> >
> > On June 17, 2025 1:41:07 PM EDT, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > >On Tue, Jun 17, 2025 at 01:36:14PM -0400, Steven Rostedt wrote:
> > >> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
> > >>
> > >> In January 2015, tracefs was created to allow access to the tracing
> > >> infrastructure without needing to compile in debugfs. When tracefs is
> > >> configured, the directory /sys/kernel/tracing will exist and tooling is
> > >> expected to use that path to access the tracing infrastructure.
> > >>
> > >> To allow backward compatibility, when debugfs is mounted, it would
> > >> automount tracefs in its "tracing" directory so that tooling that had hard
> > >> coded /sys/kernel/debug/tracing would still work.
> > >>
> > >> It has been over 10 years since the new interface was introduced, and all
> > >> tooling should now be using it. Start the process of deprecating the old
> > >> path so that it doesn't need to be maintained anymore.
> > >
> > >I've always used /debug/tracing/ (because /debug is the right place to
> > >mount debugfs). You're saying this is going away and will break all my
> > >scripts?!
> >
> > You could mount tracefs in /tracing too:
> >
> > # mount -t tracefs nodev /tracing
> >
> > And update you scripts with a simple sed script.
>
> If I have to edit the mount table, I'll just keep it at /debug/tracing/.
> Tracing is very much debug stuff anyway. While I knew there was tracefs,
> I never knew there was another mount point.
>
> Just annoying I now have to add two entries to every new machine.. Oh
> well.
It seems cleaning this up is a good thing wrt permission issues. On my
local debian derived machine:
```
$ ls /sys/kernel/debug/tracing/events
ls: cannot access '/sys/kernel/debug/tracing/events': Permission denied
$ ls /sys/kernel/tracing/events
alarmtimer fib irq nmi sunrpc
...
```
I see a number of references to debug/tracing in places like perf testing:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/shell/common/init.sh?h=perf-tools-next#n122
are you planning patches for these?
Thanks,
Ian