};
struct lttng_event_enabler {
- struct lttng_event_enabler_common base;
+ struct lttng_event_enabler_common parent;
struct list_head node; /* per-session list of enablers */
bool published; /* published in per-session list. */
struct lttng_kernel_channel_buffer *chan;
};
struct lttng_event_notifier_enabler {
- struct lttng_event_enabler_common base;
+ struct lttng_event_enabler_common parent;
uint64_t error_counter_index;
struct list_head node; /* List of event_notifier enablers */
struct lttng_event_notifier_group *group;
struct lttng_event_enabler_common *lttng_event_enabler_as_enabler(
struct lttng_event_enabler *event_enabler)
{
- return &event_enabler->base;
+ return &event_enabler->parent;
}
static inline
struct lttng_event_enabler_common *lttng_event_notifier_enabler_as_enabler(
struct lttng_event_notifier_enabler *event_notifier_enabler)
{
- return &event_notifier_enabler->base;
+ return &event_notifier_enabler->parent;
}
int lttng_context_init(void);
const struct lttng_kernel_event_desc *event_desc)
{
struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
- struct lttng_kernel_abi_event *event_param = &event_enabler->base.event_param;
+ struct lttng_kernel_abi_event *event_param = &event_enabler->parent.event_param;
enum lttng_kernel_abi_instrumentation itype = event_param->instrumentation;
struct lttng_kernel_session *session = chan->parent.session;
struct lttng_kernel_event_recorder *event_recorder;
return 0;
if (lttng_desc_match_enabler(event_notifier->priv->parent.desc, base_enabler)
&& event_notifier->priv->group == event_notifier_enabler->group
- && event_notifier->priv->parent.user_token == event_notifier_enabler->base.user_token)
+ && event_notifier->priv->parent.user_token == event_notifier_enabler->parent.user_token)
return 1;
else
return 0;
LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
lttng_hlist_for_each_entry(event_notifier_priv, head, hlist) {
if (event_notifier_priv->parent.desc == desc
- && event_notifier_priv->parent.user_token == event_notifier_enabler->base.user_token)
+ && event_notifier_priv->parent.user_token == event_notifier_enabler->parent.user_token)
found = 1;
}
if (found)
* We need to create a event_notifier for this event probe.
*/
event_notifier = _lttng_event_notifier_create(desc,
- event_notifier_enabler->base.user_token,
+ event_notifier_enabler->parent.user_token,
event_notifier_enabler->error_counter_index,
event_notifier_group, NULL,
LTTNG_KERNEL_ABI_TRACEPOINT);
static
void lttng_create_event_if_missing(struct lttng_event_enabler *event_enabler)
{
- switch (event_enabler->base.event_param.instrumentation) {
+ switch (event_enabler->parent.event_param.instrumentation) {
case LTTNG_KERNEL_ABI_TRACEPOINT:
lttng_create_tracepoint_event_if_missing(event_enabler);
break;
static
void lttng_create_event_notifier_if_missing(struct lttng_event_notifier_enabler *event_notifier_enabler)
{
- switch (event_notifier_enabler->base.event_param.instrumentation) {
+ switch (event_notifier_enabler->parent.event_param.instrumentation) {
case LTTNG_KERNEL_ABI_TRACEPOINT:
lttng_create_tracepoint_event_notifier_if_missing(event_notifier_enabler);
break;
list_for_each_entry(event_notifier_enabler, &event_notifier_group->enablers_head,
node) {
- if (event_notifier_enabler->base.enabled)
+ if (event_notifier_enabler->parent.enabled)
return true;
}
return false;
event_enabler = kzalloc(sizeof(*event_enabler), GFP_KERNEL);
if (!event_enabler)
return NULL;
- event_enabler->base.format_type = format_type;
- INIT_LIST_HEAD(&event_enabler->base.filter_bytecode_head);
- memcpy(&event_enabler->base.event_param, event_param,
- sizeof(event_enabler->base.event_param));
+ 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->chan = chan;
/* ctx left NULL */
- event_enabler->base.enabled = 0;
+ event_enabler->parent.enabled = 0;
return event_enabler;
}
if (!event_notifier_enabler)
return NULL;
- event_notifier_enabler->base.format_type = format_type;
- INIT_LIST_HEAD(&event_notifier_enabler->base.filter_bytecode_head);
+ event_notifier_enabler->parent.format_type = format_type;
+ INIT_LIST_HEAD(&event_notifier_enabler->parent.filter_bytecode_head);
INIT_LIST_HEAD(&event_notifier_enabler->capture_bytecode_head);
event_notifier_enabler->error_counter_index = event_notifier_param->error_counter_index;
event_notifier_enabler->num_captures = 0;
- memcpy(&event_notifier_enabler->base.event_param, &event_notifier_param->event,
- sizeof(event_notifier_enabler->base.event_param));
+ memcpy(&event_notifier_enabler->parent.event_param, &event_notifier_param->event,
+ sizeof(event_notifier_enabler->parent.event_param));
- event_notifier_enabler->base.enabled = 0;
- event_notifier_enabler->base.user_token = event_notifier_param->event.token;
+ event_notifier_enabler->parent.enabled = 0;
+ event_notifier_enabler->parent.user_token = event_notifier_param->event.token;
event_notifier_enabler->group = event_notifier_group;
mutex_lock(&sessions_mutex);
const struct lttng_kernel_event_desc *desc;
struct lttng_event_notifier_group *group = event_notifier_enabler->group;
struct lttng_kernel_abi_event_notifier event_notifier_param;
- uint64_t user_token = event_notifier_enabler->base.user_token;
+ uint64_t user_token = event_notifier_enabler->parent.user_token;
uint64_t error_counter_index = event_notifier_enabler->error_counter_index;
struct lttng_event_enabler_common *base_enabler = lttng_event_notifier_enabler_as_enabler(
event_notifier_enabler);
{
struct lttng_event_notifier_group *group = event_notifier_enabler->group;
const struct lttng_kernel_event_desc *desc;
- uint64_t user_token = event_notifier_enabler->base.user_token;
+ uint64_t user_token = event_notifier_enabler->parent.user_token;
uint64_t error_counter_index = event_notifier_enabler->error_counter_index;
unsigned int i;
int ret = 0;
LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
lttng_hlist_for_each_entry(event_notifier_priv, head, hlist) {
if (event_notifier_priv->parent.desc == desc
- && event_notifier_priv->parent.user_token == event_notifier_enabler->base.user_token)
+ && event_notifier_priv->parent.user_token == event_notifier_enabler->parent.user_token)
found = 1;
}
if (found)