X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fevents-internal.h;h=21d887f03f80f65410809540e6ae9e4543ac01d1;hb=546cb5f29a6b43d6240f21a1a2d1a38b2919f966;hp=5a1b91604efae411dd3e42c9a2be196090c748a7;hpb=8bff0fc3a53e182b6fdc8f70cedc564adc435afa;p=lttng-modules.git diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h index 5a1b9160..21d887f0 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -79,6 +79,7 @@ struct lttng_kernel_event_common_private { struct list_head filter_bytecode_runtime_head; struct hlist_node hlist_node; /* node in events hash table */ + struct list_head node; /* node in event list */ enum lttng_kernel_abi_instrumentation instrumentation; /* Selected by instrumentation */ @@ -102,7 +103,6 @@ struct lttng_kernel_event_recorder_private { struct lttng_kernel_event_common_private parent; struct lttng_kernel_event_recorder *pub; /* Public event interface */ - struct list_head node; /* Event recorder list */ struct lttng_kernel_ctx *ctx; unsigned int id; unsigned int metadata_dumped:1; @@ -115,7 +115,6 @@ struct lttng_kernel_event_notifier_private { struct lttng_event_notifier_group *group; /* weak ref */ size_t num_captures; /* Needed to allocate the msgpack array. */ uint64_t error_counter_index; - struct list_head node; /* Event notifier list */ struct list_head capture_bytecode_runtime_head; }; @@ -615,6 +614,27 @@ struct lttng_event_ht *lttng_get_event_ht_from_enabler(struct lttng_event_enable } } +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,