bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Beau Belgrave <beaub@linux.microsoft.com>
Cc: rostedt@goodmis.org, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	ast@kernel.org, dcook@linux.microsoft.com, brauner@kernel.org,
	dthaler@microsoft.com, bpf@vger.kernel.org
Subject: Re: [PATCH 0/5] tracing/user_events: Add auto-del flag for events
Date: Wed, 31 May 2023 14:44:44 -0700	[thread overview]
Message-ID: <20230531214444.5dqcbclgycfk3q77@MacBook-Pro-8.local> (raw)
In-Reply-To: <20230530235304.2726-1-beaub@linux.microsoft.com>

On Tue, May 30, 2023 at 04:52:59PM -0700, Beau Belgrave wrote:
> 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

This patch set is not addressing the issues I pointed out earlier.
It adds a new flag and new api. It's not a fix.

> 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_AUTO_DEL, which
> causes the event to delete itself upon the last put reference. We cannot

Do not introduce a new flag. Make this default.

> fully drop the delete IOCTL, since we still want to enable events to be
> registered early via dynamic_events and persist. If the auto delete flag
> was used during dynamic_events, the event would delete immediately.

You have to delete this broken "delete via ioctl" api.
For persistent events you need a different api in its own name scope,
so it doesn't conflict with per-fd events.

> We have a few key events that we enable immediately after boot and are
> monitored in our environments. Today this is done via dynamic events,
> however, it could also be done directly via the ABI by not passing the
> auto delete flag.
> 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/
> Beau Belgrave (5):
>   tracing/user_events: Store register flags on events
>   tracing/user_events: Track refcount consistently via put/get
>   tracing/user_events: Add flag to auto-delete events
>   tracing/user_events: Add self-test for auto-del flag
>   tracing/user_events: Add auto-del flag documentation
>  Documentation/trace/user_events.rst           |  21 +-
>  include/uapi/linux/user_events.h              |  10 +-
>  kernel/trace/trace_events_user.c              | 183 ++++++++++++++----
>  .../testing/selftests/user_events/abi_test.c  | 115 ++++++++++-
>  4 files changed, 278 insertions(+), 51 deletions(-)
> base-commit: 3862f86c1529fa0016de6344eb974877b4cd3838
> -- 
> 2.25.1

       reply	other threads:[~2023-05-31 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230530235304.2726-1-beaub@linux.microsoft.com>
2023-05-31 21:44 ` Alexei Starovoitov [this message]
2023-06-01  0:29   ` [PATCH 0/5] tracing/user_events: Add auto-del flag for events Beau Belgrave

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230531214444.5dqcbclgycfk3q77@MacBook-Pro-8.local \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=beaub@linux.microsoft.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=dcook@linux.microsoft.com \
    --cc=dthaler@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \


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