1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 * lttng-event-notifier-notification.c
5 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
8 #include <lttng/events.h>
9 #include <lttng/event-notifier-notification.h>
11 void lttng_event_notifier_notification_send(struct lttng_event_notifier
*event_notifier
)
13 struct lttng_event_notifier_group
*event_notifier_group
= event_notifier
->group
;
14 struct lib_ring_buffer_ctx ctx
;
17 if (unlikely(!READ_ONCE(event_notifier
->enabled
)))
20 lib_ring_buffer_ctx_init(&ctx
, event_notifier_group
->chan
, NULL
,
21 sizeof(event_notifier
->user_token
),
22 lttng_alignof(event_notifier
->user_token
), -1);
23 ret
= event_notifier_group
->ops
->event_reserve(&ctx
, 0);
25 //TODO: error handling with counter maps
26 //silently drop for now.
30 lib_ring_buffer_align_ctx(&ctx
, lttng_alignof(event_notifier
->user_token
));
31 event_notifier_group
->ops
->event_write(&ctx
, &event_notifier
->user_token
,
32 sizeof(event_notifier
->user_token
));
33 event_notifier_group
->ops
->event_commit(&ctx
);
34 irq_work_queue(&event_notifier_group
->wakeup_pending
);