All of lore.kernel.org
 help / color / mirror / Atom feed
* bpftool uses wrong order of tracefs search
@ 2025-09-11 17:27 Alexei Starovoitov
  2025-09-11 21:03 ` Quentin Monnet
  0 siblings, 1 reply; 5+ messages in thread
From: Alexei Starovoitov @ 2025-09-11 17:27 UTC (permalink / raw)
  To: Quentin Monnet, bpf, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Steven Rostedt

Hi Quentin,

since last merge window bpftool triggers a warn:
$ bpftool prog tracelog
[   72.942082] NOTICE: Automounting of tracing to debugfs is
deprecated and will be removed in 2030


I suspect it happens because get_tracefs_pipe()
accesses debug/tracing first which causes automnount
and triggers this warning.

Pls take a look.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bpftool uses wrong order of tracefs search
  2025-09-11 17:27 bpftool uses wrong order of tracefs search Alexei Starovoitov
@ 2025-09-11 21:03 ` Quentin Monnet
  2025-09-11 21:32   ` Alexei Starovoitov
  0 siblings, 1 reply; 5+ messages in thread
From: Quentin Monnet @ 2025-09-11 21:03 UTC (permalink / raw)
  To: Alexei Starovoitov, bpf, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Steven Rostedt

2025-09-11 10:27 UTC-0700 ~ Alexei Starovoitov
<alexei.starovoitov@gmail.com>
> Hi Quentin,
> 
> since last merge window bpftool triggers a warn:
> $ bpftool prog tracelog
> [   72.942082] NOTICE: Automounting of tracing to debugfs is
> deprecated and will be removed in 2030
> 
> 
> I suspect it happens because get_tracefs_pipe()
> accesses debug/tracing first which causes automnount
> and triggers this warning.
> 
> Pls take a look.


Hi Alexei, sure, I'll look into it.

I haven't tested yet, but the check on /sys/kernel/debug/tracing is
likely to be the cause indeed. If that's the case, would that be OK to
move it to the end of the "known_mnts" list in the function? Or do you
prefer to avoid the warning completely, even at the cost of missing the
tracefs on older systems?

Quentin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bpftool uses wrong order of tracefs search
  2025-09-11 21:03 ` Quentin Monnet
@ 2025-09-11 21:32   ` Alexei Starovoitov
  2025-09-11 21:39     ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Alexei Starovoitov @ 2025-09-11 21:32 UTC (permalink / raw)
  To: Quentin Monnet
  Cc: bpf, Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau,
	Steven Rostedt

On Thu, Sep 11, 2025 at 2:03 PM Quentin Monnet <qmo@kernel.org> wrote:
>
> 2025-09-11 10:27 UTC-0700 ~ Alexei Starovoitov
> <alexei.starovoitov@gmail.com>
> > Hi Quentin,
> >
> > since last merge window bpftool triggers a warn:
> > $ bpftool prog tracelog
> > [   72.942082] NOTICE: Automounting of tracing to debugfs is
> > deprecated and will be removed in 2030
> >
> >
> > I suspect it happens because get_tracefs_pipe()
> > accesses debug/tracing first which causes automnount
> > and triggers this warning.
> >
> > Pls take a look.
>
>
> Hi Alexei, sure, I'll look into it.
>
> I haven't tested yet, but the check on /sys/kernel/debug/tracing is
> likely to be the cause indeed. If that's the case, would that be OK to
> move it to the end of the "known_mnts" list in the function? Or do you
> prefer to avoid the warning completely, even at the cost of missing the
> tracefs on older systems?

Older kernels won't have this warn.
Also I don't know what these are:
                "/tracing",
                "/trace",
I think the fix would be to do:
"/sys/kernel/tracing",
"/sys/kernel/debug/tracing",

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bpftool uses wrong order of tracefs search
  2025-09-11 21:32   ` Alexei Starovoitov
@ 2025-09-11 21:39     ` Steven Rostedt
  2025-09-11 21:42       ` Alexei Starovoitov
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2025-09-11 21:39 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Quentin Monnet, bpf, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau

On Thu, 11 Sep 2025 14:32:50 -0700
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:

> Older kernels won't have this warn.
> Also I don't know what these are:
>                 "/tracing",
>                 "/trace",

It was common for people to hardcode the tracing and debug directories to
short names. I use to do it, and I believe Arnaldo did it as well.

> I think the fix would be to do:
> "/sys/kernel/tracing",
> "/sys/kernel/debug/tracing",

Note, the libtracefs uses /proc/mounts to find the directory. Feel free to
copy it and tweak it for your needs:

  https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/tree/src/tracefs-utils.c#n89

It has some legacy code to allow finding the debugfs directory first, which
shouldn't be needed anymore.

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bpftool uses wrong order of tracefs search
  2025-09-11 21:39     ` Steven Rostedt
@ 2025-09-11 21:42       ` Alexei Starovoitov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexei Starovoitov @ 2025-09-11 21:42 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Quentin Monnet, bpf, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau

On Thu, Sep 11, 2025 at 2:38 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Thu, 11 Sep 2025 14:32:50 -0700
> Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>
> > Older kernels won't have this warn.
> > Also I don't know what these are:
> >                 "/tracing",
> >                 "/trace",
>
> It was common for people to hardcode the tracing and debug directories to
> short names. I use to do it, and I believe Arnaldo did it as well.
>
> > I think the fix would be to do:
> > "/sys/kernel/tracing",
> > "/sys/kernel/debug/tracing",
>
> Note, the libtracefs uses /proc/mounts to find the directory. Feel free to
> copy it and tweak it for your needs:
>
>   https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/tree/src/tracefs-utils.c#n89

get_tracefs_pipe() searches /proc on 2nd step,
and I would keep it in that order, since /proc parsing isn't fast.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-11 21:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-11 17:27 bpftool uses wrong order of tracefs search Alexei Starovoitov
2025-09-11 21:03 ` Quentin Monnet
2025-09-11 21:32   ` Alexei Starovoitov
2025-09-11 21:39     ` Steven Rostedt
2025-09-11 21:42       ` Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.