From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Beau Belgrave <beaub@linux.microsoft.com>,
Tom Zanussi <zanussi@kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [GIT PULL] tracing: Updates for 5.18
Date: Wed, 23 Mar 2022 15:39:23 -0400 [thread overview]
Message-ID: <20220323153923.425be157@gandalf.local.home> (raw)
In-Reply-To: <CAHk-=wiY2iVfuwuOLbaQ1PG2sK2ZGVtCfRH+bjDyei3j5YytLA@mail.gmail.com>
On Wed, 23 Mar 2022 11:47:07 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Mon, Mar 21, 2022 at 7:56 AM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > A restructure of include/trace caused a conflict [..]
>
> Ugh. Disgusting. And in the very same pull request it shows why that
> TRACE_CUSTOM_EVENT() thing that caused this all was actually a
> horribly bad idea, since it also then DIDN'T WORK due to the kernel
> interfaces changing.
I thought I explained the reasoning behind that in my pull request.
CUSTOM events have to match the function prototype to the tracepoint that
they are on top of (which is created by the TRACE_EVENT), and if they do
not, bad things can happen at run time. Thus, the added check to make sure
it will fail at build time.
>
> So this restructuring seems to have been triggered by something that
> was a bad idea to begin with.
>
> But the real problem is here:
>
> > Tracing updates for 5.18:
> >
> > - New user_events interface. User space can register an event with the kernel
> > describing the format of the event. Then it will receive a byte in a page
> > mapping that it can check against. A privileged task can then enable that
> > event like any other event, which will change the mapped byte to true,
> > telling the user space application to start writing the event to the
> > tracing buffer.
>
> That explanation makes no sense, because it doesn't actually explain *why*.
Sorry, sometimes when you are deep into the work, things that are obvious
to yourself may not be obvious to others. Being able to know those things
is an art onto itself.
>
> It explains *what*, but the big issue for new interfaces shoudl always
> be why the heck a new interface was needed in the first place.
The why is that we have applications that run in containers that want
events to be traced. But we do not want to always trace those events. These
applications will not have an interface to talk to, to say "start tracing
X", as they are inside a container and various other reasons.
Thus, the applications can add their own trace events, and then the admin
that is outside the container can enable the events inside the container,
by enabling them from the tracefs file system, which will set a byte in the
mapping that happened when the application registered the event, where it
can now know to start tracing the event.
It does require that the application has a conditional jmp on that byte,
and not be optimized like the kernel is with static_branches.
I hope that explains things a bit better.
>
> I've pulled this, but under protest.
Thank you.
-- Steve
next prev parent reply other threads:[~2022-03-23 19:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 14:56 Steven Rostedt
2022-03-23 18:47 ` Linus Torvalds
2022-03-23 19:39 ` Steven Rostedt [this message]
2022-03-23 18:56 ` Linus Torvalds
2022-03-23 19:20 ` Linus Torvalds
2022-03-23 19:43 ` Steven Rostedt
2022-03-23 19:49 ` Linus Torvalds
2022-03-24 23:05 ` Steven Rostedt
2022-03-23 19:26 ` pr-tracker-bot
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=20220323153923.425be157@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=beaub@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
--cc=zanussi@kernel.org \
/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
all inboxes | Powered by JetHome®