linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] tracing/user_events: Add auto cleanup and a flag to persist events
@ 2023-06-05 23:38 Beau Belgrave
  2023-06-05 23:38 ` [PATCH v2 1/5] tracing/user_events: Store register flags on events Beau Belgrave
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Beau Belgrave @ 2023-06-05 23:38 UTC (permalink / raw)
  To: rostedt, mhiramat; +Cc: linux-kernel, linux-trace-kernel, ast, dcook

As part of the discussions for user_events aligning to be used with eBPF
it became clear [1] we needed a way to delete events without having to rely
upon the delete IOCTL. Steven suggested that we simply have an owner
for the event, however, the event can be held by more than just the
first register FD, such as perf/ftrace or additional registers. In order
to handle all those cases, we must only delete after all references are
gone from both user and kernel space.

This series adds a new register flag, USER_EVENT_REG_PERSIST, which
causes the event to not delete itself upon the last put reference. We
cannot fully drop the delete IOCTL, since we still want to enable events to
be registered early via dynamic_events and persist. Events that do not use
this new flag are auto-cleaned up upon no longer being used.

NOTE: I'll need to merge this work once we take these [2] [3] patches
into for-next. I'm happy to do so once they land there.

1: https://lore.kernel.org/linux-trace-kernel/20230518093600.3f119d68@rorschach.local.home/
2: https://lore.kernel.org/linux-trace-kernel/20230529032100.286534-1-sunliming@kylinos.cn/
3: https://lore.kernel.org/linux-trace-kernel/20230519230741.669-1-beaub@linux.microsoft.com/

Change history

v2:
  Renamed series to "Add auto cleanup and a flag to persist events"
  Changed auto-delete to be default behavior, with new flag to persist events

Beau Belgrave (5):
  tracing/user_events: Store register flags on events
  tracing/user_events: Track refcount consistently via put/get
  tracing/user_events: Add auto cleanup and a flag to persist events
  tracing/user_events: Add self-test for persist flag
  tracing/user_events: Add persist flag documentation

 Documentation/trace/user_events.rst           |  21 +-
 include/uapi/linux/user_events.h              |  10 +-
 kernel/trace/trace_events_user.c              | 184 ++++++++++++++----
 .../testing/selftests/user_events/abi_test.c  | 144 +++++++++++++-
 .../selftests/user_events/ftrace_test.c       |   1 +
 5 files changed, 309 insertions(+), 51 deletions(-)


base-commit: 3862f86c1529fa0016de6344eb974877b4cd3838
-- 
2.25.1


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

end of thread, other threads:[~2023-06-13 19:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05 23:38 [PATCH v2 0/5] tracing/user_events: Add auto cleanup and a flag to persist events Beau Belgrave
2023-06-05 23:38 ` [PATCH v2 1/5] tracing/user_events: Store register flags on events Beau Belgrave
2023-06-05 23:38 ` [PATCH v2 2/5] tracing/user_events: Track refcount consistently via put/get Beau Belgrave
2023-06-05 23:38 ` [PATCH v2 3/5] tracing/user_events: Add auto cleanup and a flag to persist events Beau Belgrave
2023-06-07  1:26   ` Alexei Starovoitov
2023-06-07 19:16     ` Beau Belgrave
2023-06-08 20:25   ` Steven Rostedt
2023-06-08 21:22     ` Beau Belgrave
2023-06-13 19:26   ` Steven Rostedt
2023-06-05 23:38 ` [PATCH v2 4/5] tracing/user_events: Add self-test for persist flag Beau Belgrave
2023-06-05 23:39 ` [PATCH v2 5/5] tracing/user_events: Add persist flag documentation Beau Belgrave

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).