Re: [PATCH] user_events: Enable user processes to create and write to trace events

From: Beau Belgrave
Date: Fri Oct 08 2021 - 12:09:18 EST


On Fri, Oct 08, 2021 at 01:11:59PM +0000, Peter.Enderborg@xxxxxxxx wrote:
> On 10/6/21 12:44 AM, Beau Belgrave wrote:
> > User mode processes that wish to use trace events to get data into
> > ftrace, perf, eBPF, etc are limited to uprobes today. The user events
> > features enables an ABI for user mode processes to create and write to
> > trace events that are isolated from kernel level trace events. This
> > enables a faster path for tracing from user mode data as well as opens
> > managed code to participate in trace events, where stub locations are
> > dynamic.
>
> Is this not very much what the trace_marker do?
>
At a very high level, yes, both get user data into ftrace.
This question has been brought up a few times, if you watch the LPC2021
Tracing MC session this came up and got answered.

Markers do not get user data into perf and eBPF, nor do they allow user mode
applications to know when to emit the trace_marker (we only want to trace
and incur the syscall cost when something requests that data).

We also want to be able to use all the bells and whistles of
ftrace/perf. This means supporting field labels so things like hist,
filter and triggers work on a per-event basis (IE: Durable identifier
such as the event name).

Thanks,
-Beau