mbox series

[v1,0/3] libtracefs: Add APIs for user_events to libtracefs

Message ID 20220218225058.12701-1-beaub@linux.microsoft.com (mailing list archive)
Headers show
Series libtracefs: Add APIs for user_events to libtracefs | expand

Message

Beau Belgrave Feb. 18, 2022, 10:50 p.m. UTC
New APIs added:
struct tracefs_user_event_group *tracefs_user_event_group_create(void);

void tracefs_user_event_group_close(struct tracefs_user_event_group *group);

int tracefs_user_event_delete(const char *name);

struct tracefs_user_event *
tracefs_user_event_register(struct tracefs_user_event_group *group,
                            const char *name, enum tracefs_uevent_flags flags,
                            struct tracefs_uevent_item *items);

bool tracefs_user_event_test(struct tracefs_user_event *event);

int tracefs_user_event_write(struct tracefs_user_event *event,
                             struct tracefs_uevent_item *items);

Documentation updates in this series describes the various APIs and the reason
for a group.

Items are described with a struct to better ensure contracts for things like
custom structs or static length strings. Items are allowed to be mixed/different
than what they were when registered. This allows callers the ability to describe
events verbosely, but write out via packed structs in their own code if needed.

Beau Belgrave (3):
  libtracefs: Add user_events to libtracefs sources
  libtracefs: Add documentation and sample code for user_events
  libtracefs: Add unit tests for user_events

 Documentation/libtracefs-userevents.txt | 258 +++++++++++
 Makefile                                |   8 +
 include/tracefs-local.h                 |  24 ++
 include/tracefs.h                       |  60 +++
 samples/Makefile                        |   4 +
 src/Makefile                            |   4 +
 src/tracefs-userevents.c                | 545 ++++++++++++++++++++++++
 utest/tracefs-utest.c                   | 233 ++++++++++
 8 files changed, 1136 insertions(+)
 create mode 100644 Documentation/libtracefs-userevents.txt
 create mode 100644 src/tracefs-userevents.c


base-commit: e579ba38ff6bc07cd2278faf9d3ac08c15d4e9e8

Comments

Steven Rostedt Feb. 22, 2022, 5:34 p.m. UTC | #1
On Fri, 18 Feb 2022 14:50:55 -0800
Beau Belgrave <beaub@linux.microsoft.com> wrote:

> New APIs added:

Beau,

I'm not sure what you work load is, but if you can get out a v2 today (or
tomorrow), that would be great. I want to release libtracefs 1.3 in the
next couple of days, and I'm only holding it off to include these APIs.

At the moment, libtracefs looks good to go!

Thanks,

-- Steve
Beau Belgrave Feb. 22, 2022, 5:50 p.m. UTC | #2
On Tue, Feb 22, 2022 at 12:34:47PM -0500, Steven Rostedt wrote:
> On Fri, 18 Feb 2022 14:50:55 -0800
> Beau Belgrave <beaub@linux.microsoft.com> wrote:
> 
> > New APIs added:
> 
> Beau,
> 
> I'm not sure what you work load is, but if you can get out a v2 today (or
> tomorrow), that would be great. I want to release libtracefs 1.3 in the
> next couple of days, and I'm only holding it off to include these APIs.
> 

Yeah, I can get a v2 today I think. We keep expanding what to change in
the thread (which is great) so I'll do my best to capture it all out in
the v2. I plan to start in a few hours, with what we've talked about so
far.

Thanks,
-Beau
Steven Rostedt Feb. 22, 2022, 6:20 p.m. UTC | #3
On Tue, 22 Feb 2022 09:50:45 -0800
Beau Belgrave <beaub@linux.microsoft.com> wrote:

> Yeah, I can get a v2 today I think. We keep expanding what to change in
> the thread (which is great) so I'll do my best to capture it all out in
> the v2. I plan to start in a few hours, with what we've talked about so
> far.

My only concern is that we will get an API that we want to change. But
currently I'm pretty confident that this is the API that we'll keep. We can
always add more, but once a release is out, we are stuck with that API for
good.

Thanks a lot for doing this!

-- Steve