}
}
+static inline
+struct list_head *lttng_get_event_list_head_from_enabler(struct lttng_event_enabler_common *event_enabler)
+{
+ switch (event_enabler->enabler_type) {
+ case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
+ {
+ struct lttng_event_recorder_enabler *event_recorder_enabler =
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ return &event_recorder_enabler->chan->parent.session->priv->events;
+ }
+ case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
+ {
+ struct lttng_event_notifier_enabler *event_notifier_enabler =
+ container_of(event_enabler, struct lttng_event_notifier_enabler, parent);
+ return &event_notifier_enabler->group->event_notifiers_head;
+ }
+ default:
+ return NULL;
+ }
+}
+
int lttng_context_init(void);
void lttng_context_exit(void);
int lttng_kernel_context_append(struct lttng_kernel_ctx **ctx_p,
int lttng_event_enabler_ref_events(struct lttng_event_recorder_enabler *event_enabler)
{
struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
- struct lttng_kernel_session *session = event_enabler->chan->parent.session;
struct lttng_event_enabler_common *base_enabler = lttng_event_recorder_enabler_as_enabler(event_enabler);
struct lttng_kernel_event_recorder_private *event_recorder_priv;
+ struct list_head *event_list_head = lttng_get_event_list_head_from_enabler(&event_enabler->parent);
if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_ABI_SYSCALL &&
base_enabler->event_param.u.syscall.abi == LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL &&
lttng_create_event_if_missing(&event_enabler->parent);
/* For each event matching event_enabler in session event list. */
- list_for_each_entry(event_recorder_priv, &session->priv->events, parent.node) {
+ list_for_each_entry(event_recorder_priv, event_list_head, parent.node) {
struct lttng_kernel_event_recorder *event_recorder = event_recorder_priv->pub;
struct lttng_enabler_ref *enabler_ref;
struct lttng_event_notifier_group *event_notifier_group = event_notifier_enabler->group;
struct lttng_event_enabler_common *base_enabler = lttng_event_notifier_enabler_as_enabler(event_notifier_enabler);
struct lttng_kernel_event_notifier_private *event_notifier_priv;
+ struct list_head *event_list_head = lttng_get_event_list_head_from_enabler(&event_notifier_enabler->parent);
if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_ABI_SYSCALL &&
base_enabler->event_param.u.syscall.abi == LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL &&
lttng_create_event_if_missing(&event_notifier_enabler->parent);
/* Link the created event_notifier with its associated enabler. */
- list_for_each_entry(event_notifier_priv, &event_notifier_group->event_notifiers_head, parent.node) {
+ list_for_each_entry(event_notifier_priv, event_list_head, parent.node) {
struct lttng_kernel_event_notifier *event_notifier = event_notifier_priv->pub;
struct lttng_enabler_ref *enabler_ref;