#include TRACEPOINT_INCLUDE
-/*
- * Stage 2.1 of tracepoint event generation.
- *
- * Create probe event notifier callback prototypes.
- */
-
-/* Reset all macros within TRACEPOINT_EVENT */
-#include <lttng/ust-tracepoint-event-reset.h>
-
-#undef TP_ARGS
-#define TP_ARGS(...) __VA_ARGS__
-
-#undef _TRACEPOINT_EVENT_CLASS
-#define _TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
-static void __event_notifier_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
-
-#include TRACEPOINT_INCLUDE
-
/*
* Stage 3.0 of tracepoint event generation.
*
static \
void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \
{ \
- struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __tp_data; \
- struct lttng_channel *__chan = __event_recorder->chan; \
- struct lttng_ust_lib_ring_buffer_ctx __ctx; \
- struct lttng_stack_ctx __lttng_ctx; \
- size_t __event_len, __event_align; \
+ struct lttng_ust_event_common *__event = (struct lttng_ust_event_common *) __tp_data; \
size_t __dynamic_len_idx = 0; \
const size_t __num_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_name) - 1; \
union { \
size_t __dynamic_len[__num_fields]; \
- char __filter_stack_data[2 * sizeof(unsigned long) * __num_fields]; \
+ char __interpreter_stack_data[2 * sizeof(unsigned long) * __num_fields]; \
} __stackvar; \
int __ret; \
\
if (0) \
(void) __dynamic_len_idx; /* don't warn if unused */ \
- if (!_TP_SESSION_CHECK(session, __chan->session)) \
- return; \
- if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \
- return; \
- if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \
- return; \
- if (caa_unlikely(!CMM_ACCESS_ONCE(__event_recorder->parent->enabled)))\
+ switch (__event->type) { \
+ case LTTNG_UST_EVENT_TYPE_RECORDER: \
+ { \
+ struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \
+ struct lttng_channel *__chan = __event_recorder->chan; \
+ \
+ if (!_TP_SESSION_CHECK(session, __chan->session)) \
+ return; \
+ if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \
+ return; \
+ if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \
+ return; \
+ break; \
+ } \
+ case LTTNG_UST_EVENT_TYPE_NOTIFIER: \
+ break; \
+ } \
+ if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \
return; \
if (caa_unlikely(!TP_RCU_LINK_TEST())) \
return; \
- if (caa_unlikely(!cds_list_empty(&__event_recorder->parent->filter_bytecode_runtime_head))) { \
- struct lttng_bytecode_runtime *__filter_bc_runtime; \
- int __filter_record = __event_recorder->parent->has_enablers_without_bytecode; \
+ if (caa_unlikely(!cds_list_empty(&__event->filter_bytecode_runtime_head))) { \
+ struct lttng_bytecode_runtime *__filter_bc_runtime; \
+ int __filter_record = __event->has_enablers_without_bytecode; \
\
- __event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__filter_stack_data, \
+ __event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
_TP_ARGS_DATA_VAR(_args)); \
- tp_list_for_each_entry_rcu(__filter_bc_runtime, &__event_recorder->parent->filter_bytecode_runtime_head, node) { \
+ tp_list_for_each_entry_rcu(__filter_bc_runtime, &__event->filter_bytecode_runtime_head, node) { \
if (caa_unlikely(__filter_bc_runtime->interpreter_funcs.filter(__filter_bc_runtime, \
- __stackvar.__filter_stack_data) & LTTNG_INTERPRETER_RECORD_FLAG)) { \
+ __stackvar.__interpreter_stack_data) & LTTNG_INTERPRETER_RECORD_FLAG)) { \
__filter_record = 1; \
break; \
} \
if (caa_likely(!__filter_record)) \
return; \
} \
- __event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
- _TP_ARGS_DATA_VAR(_args)); \
- __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
- memset(&__lttng_ctx, 0, sizeof(__lttng_ctx)); \
- __lttng_ctx.event_recorder = __event_recorder; \
- __lttng_ctx.chan_ctx = tp_rcu_dereference(__chan->ctx); \
- __lttng_ctx.event_ctx = tp_rcu_dereference(__event_recorder->ctx); \
- lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_ctx, __event_len, \
- __event_align, -1, __chan->handle); \
- __ctx.ip = _TP_IP_PARAM(TP_IP_PARAM); \
- __ret = __chan->ops->event_reserve(&__ctx, __event_recorder->id); \
- if (__ret < 0) \
- return; \
- _fields \
- __chan->ops->event_commit(&__ctx); \
+ switch (__event->type) { \
+ case LTTNG_UST_EVENT_TYPE_RECORDER: \
+ { \
+ size_t __event_len, __event_align; \
+ struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \
+ struct lttng_channel *__chan = __event_recorder->chan; \
+ struct lttng_ust_lib_ring_buffer_ctx __ctx; \
+ struct lttng_stack_ctx __lttng_ctx; \
+ \
+ __event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
+ _TP_ARGS_DATA_VAR(_args)); \
+ __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
+ memset(&__lttng_ctx, 0, sizeof(__lttng_ctx)); \
+ __lttng_ctx.event_recorder = __event_recorder; \
+ __lttng_ctx.chan_ctx = tp_rcu_dereference(__chan->ctx); \
+ __lttng_ctx.event_ctx = tp_rcu_dereference(__event_recorder->ctx); \
+ lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_ctx, __event_len, \
+ __event_align, -1, __chan->handle); \
+ __ctx.ip = _TP_IP_PARAM(TP_IP_PARAM); \
+ __ret = __chan->ops->event_reserve(&__ctx, __event_recorder->id); \
+ if (__ret < 0) \
+ return; \
+ _fields \
+ __chan->ops->event_commit(&__ctx); \
+ break; \
+ } \
+ case LTTNG_UST_EVENT_TYPE_NOTIFIER: \
+ { \
+ struct lttng_ust_event_notifier *__event_notifier = (struct lttng_ust_event_notifier *) __event->child; \
+ \
+ if (caa_unlikely(!cds_list_empty(&__event_notifier->capture_bytecode_runtime_head))) \
+ __event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
+ _TP_ARGS_DATA_VAR(_args)); \
+ \
+ __event_notifier->notification_send(__event_notifier, \
+ __stackvar.__interpreter_stack_data); \
+ break; \
+ } \
+ } \
}
#include TRACEPOINT_INCLUDE
#undef _TP_EXTRACT_STRING2
-/*
- * Stage 5.2 of tracepoint event generation.
- *
- * Create the event notifier probe function.
- */
-#undef _TRACEPOINT_EVENT_CLASS
-#define _TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
-static lttng_ust_notrace \
-void __event_notifier_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); \
-static \
-void __event_notifier_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \
-{ \
- struct lttng_ust_event_notifier *__event_notifier = (struct lttng_ust_event_notifier *) __tp_data; \
- const size_t __num_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_name) - 1;\
- union { \
- size_t __dynamic_len[__num_fields]; \
- char __interpreter_stack_data[2 * sizeof(unsigned long) * __num_fields]; \
- } __stackvar; \
- \
- if (caa_unlikely(!CMM_ACCESS_ONCE(__event_notifier->parent->enabled))) \
- return; \
- if (caa_unlikely(!TP_RCU_LINK_TEST())) \
- return; \
- if (caa_unlikely(!cds_list_empty(&__event_notifier->parent->filter_bytecode_runtime_head))) { \
- struct lttng_bytecode_runtime *__filter_bc_runtime; \
- int __filter_record = __event_notifier->parent->has_enablers_without_bytecode; \
- \
- __event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
- _TP_ARGS_DATA_VAR(_args)); \
- tp_list_for_each_entry_rcu(__filter_bc_runtime, &__event_notifier->parent->filter_bytecode_runtime_head, node) { \
- if (caa_unlikely(__filter_bc_runtime->interpreter_funcs.filter(__filter_bc_runtime, \
- __stackvar.__interpreter_stack_data) & LTTNG_INTERPRETER_RECORD_FLAG)) \
- __filter_record = 1; \
- } \
- if (caa_likely(!__filter_record)) \
- return; \
- } \
- if (caa_unlikely(!cds_list_empty(&__event_notifier->capture_bytecode_runtime_head))) \
- __event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
- _TP_ARGS_DATA_VAR(_args)); \
- \
- __event_notifier->notification_send(__event_notifier, \
- __stackvar.__interpreter_stack_data); \
-}
-
-#include TRACEPOINT_INCLUDE
-
/*
* Stage 6 of tracepoint event generation.
*
.u = { \
.ext = { \
.model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \
- .event_notifier_callback = (void (*)(void)) &__event_notifier_probe__##_provider##___##_template,\
}, \
}, \
};
return &sessions;
}
-static void _lttng_event_recorder_destroy(struct lttng_ust_event_recorder *event_recorder);
-static void _lttng_event_notifier_destroy(
- struct lttng_ust_event_notifier *event_notifier);
+static void _lttng_event_destroy(struct lttng_ust_event_common *event);
static void _lttng_enum_destroy(struct lttng_enum *_enum);
static
}
static
-void register_event_recorder(struct lttng_ust_event_recorder *event_recorder)
+void register_event(struct lttng_ust_event_common *event)
{
int ret;
const struct lttng_event_desc *desc;
- assert(event_recorder->parent->priv->registered == 0);
- desc = event_recorder->parent->priv->desc;
+ assert(event->priv->registered == 0);
+ desc = event->priv->desc;
ret = __tracepoint_probe_register_queue_release(desc->name,
desc->probe_callback,
- event_recorder, desc->signature);
+ event, desc->signature);
WARN_ON_ONCE(ret);
if (!ret)
- event_recorder->parent->priv->registered = 1;
+ event->priv->registered = 1;
}
static
-void register_event_notifier(struct lttng_ust_event_notifier *event_notifier)
+void unregister_event(struct lttng_ust_event_common *event)
{
int ret;
const struct lttng_event_desc *desc;
- assert(event_notifier->parent->priv->registered == 0);
- desc = event_notifier->parent->priv->desc;
- ret = __tracepoint_probe_register_queue_release(desc->name,
- desc->u.ext.event_notifier_callback, event_notifier, desc->signature);
- WARN_ON_ONCE(ret);
- if (!ret)
- event_notifier->parent->priv->registered = 1;
-}
-
-static
-void unregister_event_recorder(struct lttng_ust_event_recorder *event_recorder)
-{
- int ret;
- const struct lttng_event_desc *desc;
-
- assert(event_recorder->parent->priv->registered == 1);
- desc = event_recorder->parent->priv->desc;
+ assert(event->priv->registered == 1);
+ desc = event->priv->desc;
ret = __tracepoint_probe_unregister_queue_release(desc->name,
desc->probe_callback,
- event_recorder);
+ event);
WARN_ON_ONCE(ret);
if (!ret)
- event_recorder->parent->priv->registered = 0;
+ event->priv->registered = 0;
}
static
-void unregister_event_notifier(struct lttng_ust_event_notifier *event_notifier)
+void _lttng_event_unregister(struct lttng_ust_event_common *event)
{
- int ret;
- const struct lttng_event_desc *desc;
-
- assert(event_notifier->parent->priv->registered == 1);
- desc = event_notifier->parent->priv->desc;
- ret = __tracepoint_probe_unregister_queue_release(desc->name,
- desc->u.ext.event_notifier_callback, event_notifier);
- WARN_ON_ONCE(ret);
- if (!ret)
- event_notifier->parent->priv->registered = 0;
-}
-
-/*
- * Only used internally at session destruction.
- */
-static
-void _lttng_event_recorder_unregister(struct lttng_ust_event_recorder *event_recorder)
-{
- if (event_recorder->parent->priv->registered)
- unregister_event_recorder(event_recorder);
-}
-
-/*
- * Only used internally at session destruction.
- */
-static
-void _lttng_event_notifier_unregister(struct lttng_ust_event_notifier *event_notifier)
-{
- if (event_notifier->parent->priv->registered)
- unregister_event_notifier(event_notifier);
+ if (event->priv->registered)
+ unregister_event(event);
}
void lttng_session_destroy(struct lttng_session *session)
CMM_ACCESS_ONCE(session->active) = 0;
cds_list_for_each_entry(event_recorder_priv, &session->priv->events_head, node) {
- _lttng_event_recorder_unregister(event_recorder_priv->pub);
+ _lttng_event_unregister(event_recorder_priv->parent.pub);
}
lttng_ust_urcu_synchronize_rcu(); /* Wait for in-flight events to complete */
__tracepoint_probe_prune_release_queue();
lttng_event_enabler_destroy(event_enabler);
cds_list_for_each_entry_safe(event_recorder_priv, tmpevent_recorder_priv,
&session->priv->events_head, node)
- _lttng_event_recorder_destroy(event_recorder_priv->pub);
+ _lttng_event_destroy(event_recorder_priv->parent.pub);
cds_list_for_each_entry_safe(_enum, tmp_enum,
&session->priv->enums_head, node)
_lttng_enum_destroy(_enum);
{
int close_ret;
struct lttng_event_notifier_enabler *notifier_enabler, *tmpnotifier_enabler;
- struct lttng_ust_event_notifier_private *notifier_priv, *tmpnotifier_priv;
+ struct lttng_ust_event_notifier_private *event_notifier_priv, *tmpevent_notifier_priv;
if (!event_notifier_group) {
return;
}
- cds_list_for_each_entry(notifier_priv,
+ cds_list_for_each_entry(event_notifier_priv,
&event_notifier_group->event_notifiers_head, node)
- _lttng_event_notifier_unregister(notifier_priv->pub);
+ _lttng_event_unregister(event_notifier_priv->parent.pub);
lttng_ust_urcu_synchronize_rcu();
&event_notifier_group->enablers_head, node)
lttng_event_notifier_enabler_destroy(notifier_enabler);
- cds_list_for_each_entry_safe(notifier_priv, tmpnotifier_priv,
+ cds_list_for_each_entry_safe(event_notifier_priv, tmpevent_notifier_priv,
&event_notifier_group->event_notifiers_head, node)
- _lttng_event_notifier_destroy(notifier_priv->pub);
+ _lttng_event_destroy(event_notifier_priv->parent.pub);
if (event_notifier_group->error_counter)
lttng_ust_counter_destroy(event_notifier_group->error_counter);
}
event_recorder->parent->struct_size = sizeof(struct lttng_ust_event_common);
event_recorder->parent->type = LTTNG_UST_EVENT_TYPE_RECORDER;
+ event_recorder->parent->child = event_recorder;
event_recorder_priv = zmalloc(sizeof(struct lttng_ust_event_recorder_private));
if (!event_recorder_priv) {
goto sessiond_register_error;
}
- cds_list_add(&event_recorder->priv->node, &chan->session->priv->events_head);
- cds_hlist_add_head(&event_recorder->priv->hlist, head);
+ cds_list_add(&event_recorder_priv->node, &chan->session->priv->events_head);
+ cds_hlist_add_head(&event_recorder_priv->hlist, head);
return 0;
sessiond_register_error:
}
event_notifier->parent->struct_size = sizeof(struct lttng_ust_event_common);
event_notifier->parent->type = LTTNG_UST_EVENT_TYPE_NOTIFIER;
+ event_notifier->parent->child = event_notifier;
event_notifier_priv = zmalloc(sizeof(struct lttng_ust_event_notifier_private));
if (!event_notifier_priv) {
return ret;
}
-static
-void _lttng_event_notifier_destroy(struct lttng_ust_event_notifier *event_notifier)
-{
- struct lttng_enabler_ref *enabler_ref, *tmp_enabler_ref;
-
- /* Remove from event_notifier list. */
- cds_list_del(&event_notifier->priv->node);
- /* Remove from event_notifier hash table. */
- cds_hlist_del(&event_notifier->priv->hlist);
-
- lttng_free_event_filter_runtime(event_notifier->parent);
-
- /* Free event_notifier enabler refs */
- cds_list_for_each_entry_safe(enabler_ref, tmp_enabler_ref,
- &event_notifier->priv->parent.enablers_ref_head, node)
- free(enabler_ref);
- free(event_notifier->priv);
- free(event_notifier->parent);
- free(event_notifier);
-}
-
static
int lttng_desc_match_star_glob_enabler(const struct lttng_event_desc *desc,
struct lttng_enabler *enabler)
* tracepoint probes.
*/
static
-void lttng_create_event_if_missing(struct lttng_event_enabler *event_enabler)
+void lttng_create_event_recorder_if_missing(struct lttng_event_enabler *event_enabler)
{
struct lttng_session *session = event_enabler->chan->session;
struct lttng_probe_desc *probe_desc;
static
void probe_provider_event_for_each(struct lttng_probe_desc *provider_desc,
- void (*event_func)(struct lttng_session *session,
- struct lttng_ust_event_recorder *event_recorder),
- void (*event_notifier_func)(struct lttng_ust_event_notifier *event_notifier))
+ void (*event_func)(struct lttng_ust_event_common *event))
{
struct cds_hlist_node *node, *tmp_node;
struct cds_list_head *sessionsp;
for (i = 0; i < provider_desc->nr_events; i++) {
const struct lttng_event_desc *event_desc;
struct lttng_event_notifier_group *event_notifier_group;
+ struct lttng_ust_event_recorder_private *event_recorder_priv;
struct lttng_ust_event_notifier_private *event_notifier_priv;
struct lttng_ust_session_private *session_priv;
struct cds_hlist_head *head;
- struct lttng_ust_event_recorder_private *event_recorder_priv;
event_desc = provider_desc->event_desc[i];
cds_hlist_for_each_entry_safe(event_recorder_priv, node, tmp_node, head, hlist) {
if (event_desc == event_recorder_priv->parent.desc) {
- event_func(session_priv->pub, event_recorder_priv->pub);
+ event_func(event_recorder_priv->parent.pub);
break;
}
}
cds_hlist_for_each_entry_safe(event_notifier_priv, node, tmp_node, head, hlist) {
if (event_desc == event_notifier_priv->parent.desc) {
- event_notifier_func(event_notifier_priv->pub);
+ event_func(event_notifier_priv->parent.pub);
break;
}
}
}
static
-void _unregister_event_recorder(struct lttng_session *session,
- struct lttng_ust_event_recorder *event_recorder)
+void _event_enum_destroy(struct lttng_ust_event_common *event)
{
- _lttng_event_recorder_unregister(event_recorder);
-}
-static
-void _event_enum_destroy(struct lttng_session *session,
- struct lttng_ust_event_recorder *event_recorder)
-{
- unsigned int i;
-
- /* Destroy enums of the current event. */
- for (i = 0; i < event_recorder->parent->priv->desc->nr_fields; i++) {
- const struct lttng_enum_desc *enum_desc;
- const struct lttng_event_field *field;
- struct lttng_enum *curr_enum;
-
- field = &(event_recorder->parent->priv->desc->fields[i]);
- switch (field->type.atype) {
- case atype_enum_nestable:
- enum_desc = field->type.u.enum_nestable.desc;
- break;
- default:
- continue;
- }
+ switch (event->type) {
+ case LTTNG_UST_EVENT_TYPE_RECORDER:
+ {
+ struct lttng_ust_event_recorder *event_recorder = event->child;
+ struct lttng_session *session = event_recorder->chan->session;
+ unsigned int i;
+
+ /* Destroy enums of the current event. */
+ for (i = 0; i < event_recorder->parent->priv->desc->nr_fields; i++) {
+ const struct lttng_enum_desc *enum_desc;
+ const struct lttng_event_field *field;
+ struct lttng_enum *curr_enum;
+
+ field = &(event_recorder->parent->priv->desc->fields[i]);
+ switch (field->type.atype) {
+ case atype_enum_nestable:
+ enum_desc = field->type.u.enum_nestable.desc;
+ break;
+ default:
+ continue;
+ }
- curr_enum = lttng_ust_enum_get_from_desc(session, enum_desc);
- if (curr_enum) {
- _lttng_enum_destroy(curr_enum);
+ curr_enum = lttng_ust_enum_get_from_desc(session, enum_desc);
+ if (curr_enum) {
+ _lttng_enum_destroy(curr_enum);
+ }
}
+ break;
+ }
+ case LTTNG_UST_EVENT_TYPE_NOTIFIER:
+ break;
+ default:
+ abort();
}
-
/* Destroy event. */
- _lttng_event_recorder_destroy(event_recorder);
+ _lttng_event_destroy(event);
}
/*
* Iterate over all events in the probe provider descriptions and sessions
* to queue the unregistration of the events.
*/
- probe_provider_event_for_each(provider_desc, _unregister_event_recorder,
- _lttng_event_notifier_unregister);
+ probe_provider_event_for_each(provider_desc, _lttng_event_unregister);
/* Wait for grace period. */
lttng_ust_urcu_synchronize_rcu();
* It is now safe to destroy the events and remove them from the event list
* and hashtables.
*/
- probe_provider_event_for_each(provider_desc, _event_enum_destroy,
- _lttng_event_notifier_destroy);
+ probe_provider_event_for_each(provider_desc, _event_enum_destroy);
}
/*
* and add backward reference from the event to the enabler.
*/
static
-int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler)
+int lttng_event_enabler_ref_event_recorders(struct lttng_event_enabler *event_enabler)
{
struct lttng_session *session = event_enabler->chan->session;
struct lttng_ust_event_recorder_private *event_recorder_priv;
goto end;
/* First ensure that probe events are created for this enabler. */
- lttng_create_event_if_missing(event_enabler);
+ lttng_create_event_recorder_if_missing(event_enabler);
/* For each event matching enabler in session event list. */
cds_list_for_each_entry(event_recorder_priv, &session->priv->events_head, node) {
return;
}
-/*
- * Only used internally at session destruction.
- */
static
-void _lttng_event_recorder_destroy(struct lttng_ust_event_recorder *event_recorder)
+void _lttng_event_destroy(struct lttng_ust_event_common *event)
{
struct lttng_enabler_ref *enabler_ref, *tmp_enabler_ref;
- /* Remove from event list. */
- cds_list_del(&event_recorder->priv->node);
- /* Remove from event hash table. */
- cds_hlist_del(&event_recorder->priv->hlist);
-
- lttng_destroy_context(event_recorder->ctx);
- lttng_free_event_filter_runtime(event_recorder->parent);
+ lttng_free_event_filter_runtime(event);
/* Free event enabler refs */
cds_list_for_each_entry_safe(enabler_ref, tmp_enabler_ref,
- &event_recorder->parent->priv->enablers_ref_head, node)
+ &event->priv->enablers_ref_head, node)
free(enabler_ref);
- free(event_recorder->priv);
- free(event_recorder->parent);
- free(event_recorder);
+
+ switch (event->type) {
+ case LTTNG_UST_EVENT_TYPE_RECORDER:
+ {
+ struct lttng_ust_event_recorder *event_recorder = event->child;
+
+ /* Remove from event list. */
+ cds_list_del(&event_recorder->priv->node);
+ /* Remove from event hash table. */
+ cds_hlist_del(&event_recorder->priv->hlist);
+
+ lttng_destroy_context(event_recorder->ctx);
+ free(event_recorder->parent);
+ free(event_recorder->priv);
+ free(event_recorder);
+ break;
+ }
+ case LTTNG_UST_EVENT_TYPE_NOTIFIER:
+ {
+ struct lttng_ust_event_notifier *event_notifier = event->child;
+
+ /* Remove from event list. */
+ cds_list_del(&event_notifier->priv->node);
+ /* Remove from event hash table. */
+ cds_hlist_del(&event_notifier->priv->hlist);
+
+ free(event_notifier->priv);
+ free(event_notifier->parent);
+ free(event_notifier);
+ break;
+ }
+ default:
+ abort();
+ }
}
static
struct lttng_ust_event_recorder_private *event_recorder_priv;
cds_list_for_each_entry(event_enabler, &session->priv->enablers_head, node)
- lttng_event_enabler_ref_events(event_enabler);
+ lttng_event_enabler_ref_event_recorders(event_enabler);
/*
* For each event, if at least one of its enablers is enabled,
* and its channel and session transient states are enabled, we
*/
if (enabled) {
if (!event_recorder_priv->parent.registered)
- register_event_recorder(event_recorder_priv->pub);
+ register_event(event_recorder_priv->parent.pub);
} else {
if (event_recorder_priv->parent.registered)
- unregister_event_recorder(event_recorder_priv->pub);
+ unregister_event(event_recorder_priv->parent.pub);
}
/* Check if has enablers without bytecode enabled */
*/
if (enabled) {
if (!event_notifier_priv->parent.registered)
- register_event_notifier(event_notifier_priv->pub);
+ register_event(event_notifier_priv->parent.pub);
} else {
if (event_notifier_priv->parent.registered)
- unregister_event_notifier(event_notifier_priv->pub);
+ unregister_event(event_notifier_priv->parent.pub);
}
/* Check if has enablers without bytecode enabled */