bool published; /* published in list. */
};
-struct lttng_event_recorder_enabler {
+struct lttng_event_enabler_session_common {
struct lttng_event_enabler_common parent;
+ struct lttng_kernel_channel_common *chan;
+};
+
+struct lttng_event_recorder_enabler {
+ struct lttng_event_enabler_session_common parent;
struct lttng_kernel_channel_buffer *chan;
};
struct lttng_kernel_probe_ctx *probe_ctx,
void *event_filter_ctx);
-static inline
-struct lttng_event_enabler_common *lttng_event_recorder_enabler_as_enabler(
- struct lttng_event_recorder_enabler *event_recorder_enabler)
-{
- return &event_recorder_enabler->parent;
-}
-
static inline
struct lttng_event_enabler_common *lttng_event_notifier_enabler_as_enabler(
struct lttng_event_notifier_enabler *event_notifier_enabler)
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
return &event_recorder_enabler->chan->parent.session->priv->events_ht;
}
case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
return &event_recorder_enabler->chan->parent.session->priv->events;
}
case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
* We tolerate no failure path after event creation. It
* will stay invariant for the rest of the session.
*/
- event = lttng_kernel_event_create(&event_enabler->parent, NULL);
+ event = lttng_kernel_event_create(&event_enabler->parent.parent, NULL);
WARN_ON_ONCE(IS_ERR(event));
- lttng_event_enabler_destroy(&event_enabler->parent);
+ lttng_event_enabler_destroy(&event_enabler->parent.parent);
if (IS_ERR(event)) {
ret = PTR_ERR(event);
goto event_error;
}
case LTTNG_KERNEL_ABI_OLD_ENABLE:
case LTTNG_KERNEL_ABI_ENABLE:
- return lttng_event_enabler_enable(&event_enabler->parent);
+ return lttng_event_enabler_enable(&event_enabler->parent.parent);
case LTTNG_KERNEL_ABI_OLD_DISABLE:
case LTTNG_KERNEL_ABI_DISABLE:
- return lttng_event_enabler_disable(&event_enabler->parent);
+ return lttng_event_enabler_disable(&event_enabler->parent.parent);
case LTTNG_KERNEL_ABI_FILTER:
- return lttng_event_enabler_attach_filter_bytecode(&event_enabler->parent,
+ return lttng_event_enabler_attach_filter_bytecode(&event_enabler->parent.parent,
(struct lttng_kernel_abi_filter_bytecode __user *) arg);
case LTTNG_KERNEL_ABI_ADD_CALLSITE:
return -EINVAL;
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
struct lttng_kernel_channel_buffer *chan = event_recorder_enabler->chan;
switch (itype) {
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
struct lttng_kernel_event_recorder *event_recorder;
struct lttng_kernel_event_recorder_private *event_recorder_priv;
struct lttng_kernel_channel_buffer *chan = event_recorder_enabler->chan;
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
event_enabler = kzalloc(sizeof(*event_enabler), GFP_KERNEL);
if (!event_enabler)
return NULL;
- event_enabler->parent.enabler_type = LTTNG_EVENT_ENABLER_TYPE_RECORDER;
- event_enabler->parent.format_type = format_type;
- INIT_LIST_HEAD(&event_enabler->parent.filter_bytecode_head);
- memcpy(&event_enabler->parent.event_param, event_param,
- sizeof(event_enabler->parent.event_param));
+ event_enabler->parent.parent.enabler_type = LTTNG_EVENT_ENABLER_TYPE_RECORDER;
+ event_enabler->parent.parent.format_type = format_type;
+ INIT_LIST_HEAD(&event_enabler->parent.parent.filter_bytecode_head);
+ memcpy(&event_enabler->parent.parent.event_param, event_param,
+ sizeof(event_enabler->parent.parent.event_param));
event_enabler->chan = chan;
+ event_enabler->parent.chan = &chan->parent;
+
/* ctx left NULL */
- event_enabler->parent.enabled = 0;
+ event_enabler->parent.parent.enabled = 0;
return event_enabler;
}
struct lttng_event_recorder_enabler *event_enabler)
{
mutex_lock(&sessions_mutex);
- list_add(&event_enabler->parent.node, &session->priv->enablers_head);
- event_enabler->parent.published = true;
+ list_add(&event_enabler->parent.parent.node, &session->priv->enablers_head);
+ event_enabler->parent.parent.published = true;
lttng_session_lazy_sync_event_enablers(session);
mutex_unlock(&sessions_mutex);
}
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
kfree(event_recorder_enabler);
break;
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
lttng_session_lazy_sync_event_enablers(event_recorder_enabler->chan->parent.session);
break;
}
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent.parent);
return &event_recorder_enabler->chan->priv->parent.syscall_table;
}
case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
struct lttng_event_recorder_enabler *syscall_event_recorder_enabler =
- container_of(syscall_event_enabler, struct lttng_event_recorder_enabler, parent);
+ container_of(syscall_event_enabler, struct lttng_event_recorder_enabler, parent.parent);
struct lttng_event_recorder_enabler *event_recorder_enabler;
struct lttng_kernel_abi_event ev;
WARN_ON_ONCE(!event_recorder_enabler);
if (!event_recorder_enabler)
return;
- event = _lttng_kernel_event_create(&event_recorder_enabler->parent, desc);
+ event = _lttng_kernel_event_create(&event_recorder_enabler->parent.parent, desc);
WARN_ON_ONCE(IS_ERR(event));
- lttng_event_enabler_destroy(&event_recorder_enabler->parent);
+ lttng_event_enabler_destroy(&event_recorder_enabler->parent.parent);
if (IS_ERR(event)) {
printk(KERN_INFO "Unable to create event recorder %s\n", desc->event_name);
return;