From: Beau Belgrave <beaub@linux.microsoft.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mhiramat@kernel.org, linux-trace-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 00/12] user_events: Enable user processes to create and write to trace events
Date: Fri, 11 Feb 2022 16:15:49 -0800 [thread overview]
Message-ID: <20220212001549.GA10191@kbox> (raw)
In-Reply-To: <20220210230021.3baf81ce@rorschach.local.home>
On Thu, Feb 10, 2022 at 11:00:21PM -0500, Steven Rostedt wrote:
> On Tue, 18 Jan 2022 12:43:14 -0800
> Beau Belgrave <beaub@linux.microsoft.com> 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.
>
> So I finished my review, and I'm currently added it to my queue that
> I'm running through my tests.
>
> Before I accept it though, I would really like you to send patches to
> linux-trace-devel@vger.kernel.org that add an API to libtracefs:
>
> https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
>
> Something where users do not need to know about ioctls, or iovecs, etc.
>
> struct tracefs_user_event *
> tracefs_user_event_register(const char *name,
> enum tracefs_uevent_type type,
> char *field, ...);
>
> Where tracefs_uevent_type can be:
>
> enum tracefs_uevent_type {
> TRACEFS_UEVENT_END,
> TRACEFS_UEVENT_u8,
> TRACEFS_UEVENT_s8,
> TRACEFS_UEVENT_u16,
> ...
> };
>
> uevent = tracefs_user_event_register("test",
> TRACEFS_UEVENT_u64, "count",
> TRACEFS_UEVENT_string, "name",
> TRACEFS_UEVENT_array, 16, "array",
> TRACEFS_UEVENT_END);
>
> and that will do the ioctl to register the event, with the given types
> and fields.
>
> struct tracefs_user_event_status *ustatus;
>
> ustatus = tracefs_user_event_status(); // does the mmap.
>
>
> Then we could also have:
>
> if (tracefs_user_event_test(ustatus, uevent))
> tracefs_user_event_write(uevent, 64, "string", { 16 byte data });
>
> The ustatus will be the mmap and the uevent will have the information
> to know where on the mmap to test for the event.
>
> As for the write, the types are saved, and the write function will have
> variable arguments defined by the tracefs_user_event_register().
>
> I think having that interface in libtracefs, would make this easy to
> use for everyone.
Agreed, I'll get going on this.
For performance I'm likely going to be play around with the shape of the
API. But it will look similar to the above.
Thanks,
-Beau
prev parent reply other threads:[~2022-02-12 0:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 20:43 [PATCH v10 00/12] user_events: Enable user processes to create and write to trace events Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 01/12] user_events: Add minimal support for trace_event into ftrace Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 02/12] user_events: Add print_fmt generation support for basic types Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 03/12] user_events: Handle matching arguments from dyn_events Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 04/12] user_events: Add basic perf and eBPF support Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 05/12] user_events: Optimize writing events by only copying data once Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 06/12] user_events: Validate user payloads for size and null termination Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 07/12] user_events: Add self-test for ftrace integration Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 08/12] user_events: Add self-test for dynamic_events integration Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 09/12] user_events: Add self-test for perf_event integration Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 10/12] user_events: Add self-test for validator boundaries Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 11/12] user_events: Add sample code for typical usage Beau Belgrave
2022-01-18 20:43 ` [PATCH v10 12/12] user_events: Add documentation file Beau Belgrave
2022-01-19 8:32 ` [PATCH v10 00/12] user_events: Enable user processes to create and write to trace events Masami Hiramatsu
2022-01-21 19:28 ` Beau Belgrave
2022-02-11 4:00 ` Steven Rostedt
2022-02-12 0:15 ` Beau Belgrave [this message]
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=20220212001549.GA10191@kbox \
--to=beaub@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).