struct lttng_kernel_session *session = chan->parent.session;
struct lttng_kernel_event_recorder *event_recorder;
struct lttng_kernel_event_recorder_private *event_recorder_priv;
+ struct lttng_kernel_event_common_private *event_priv;
const char *event_name;
struct hlist_head *head;
int ret;
head = utils_borrow_hash_table_bucket(session->priv->events_ht.table,
LTTNG_EVENT_HT_SIZE, event_name);
- lttng_hlist_for_each_entry(event_recorder_priv, head, hlist) {
- WARN_ON_ONCE(!event_recorder_priv->parent.desc);
- if (!strncmp(event_recorder_priv->parent.desc->event_name, event_name,
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ event_recorder_priv = container_of(event_priv, struct lttng_kernel_event_recorder_private, parent);
+
+ WARN_ON_ONCE(!event_priv->desc);
+ if (!strncmp(event_priv->desc->event_name, event_name,
LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1)
&& chan == event_recorder_priv->pub->chan) {
ret = -EEXIST;
if (ret) {
goto statedump_error;
}
- hlist_add_head(&event_recorder->priv->hlist, head);
+ hlist_add_head(&event_recorder->priv->parent.hlist_node, head);
list_add(&event_recorder->priv->node, &chan->parent.session->priv->events);
return event_recorder;
enum lttng_kernel_abi_instrumentation itype = event_param->instrumentation;
struct lttng_kernel_event_notifier *event_notifier;
struct lttng_kernel_event_notifier_private *event_notifier_priv;
+ struct lttng_kernel_event_common_private *event_priv;
struct lttng_counter *error_counter;
const char *event_name;
struct hlist_head *head;
head = utils_borrow_hash_table_bucket(event_notifier_group->events_ht.table,
LTTNG_EVENT_HT_SIZE, event_name);
- lttng_hlist_for_each_entry(event_notifier_priv, head, hlist) {
- WARN_ON_ONCE(!event_notifier_priv->parent.desc);
- if (!strncmp(event_notifier_priv->parent.desc->event_name, event_name,
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ event_notifier_priv = container_of(event_priv, struct lttng_kernel_event_notifier_private, parent);
+
+ WARN_ON_ONCE(!event_priv->desc);
+ if (!strncmp(event_priv->desc->event_name, event_name,
LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1)
&& event_notifier_group == event_notifier_priv->group
- && token == event_notifier_priv->parent.user_token) {
+ && token == event_priv->user_token) {
ret = -EEXIST;
goto exist;
}
}
list_add(&event_notifier->priv->node, &event_notifier_group->event_notifiers_head);
- hlist_add_head(&event_notifier->priv->hlist, head);
+ hlist_add_head(&event_notifier->priv->parent.hlist_node, head);
/*
* Clear the error counter bucket. The sessiond keeps track of which
for (i = 0; i < probe_desc->nr_events; i++) {
int found = 0;
struct hlist_head *head;
- struct lttng_kernel_event_recorder_private *event_recorder_private;
+ struct lttng_kernel_event_recorder_private *event_recorder_priv;
struct lttng_kernel_event_recorder *event_recorder;
+ struct lttng_kernel_event_common_private *event_priv;
desc = probe_desc->event_desc[i];
if (!lttng_desc_match_enabler(desc,
head = utils_borrow_hash_table_bucket(
session->priv->events_ht.table, LTTNG_EVENT_HT_SIZE,
desc->event_name);
- lttng_hlist_for_each_entry(event_recorder_private, head, hlist) {
- if (event_recorder_private->parent.desc == desc
- && event_recorder_private->pub->chan == event_enabler->chan)
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ event_recorder_priv = container_of(event_priv, struct lttng_kernel_event_recorder_private, parent);
+ if (event_priv->desc == desc
+ && event_recorder_priv->pub->chan == event_enabler->chan)
found = 1;
}
if (found)
for (i = 0; i < probe_desc->nr_events; i++) {
int found = 0;
struct hlist_head *head;
- struct lttng_kernel_event_notifier_private *event_notifier_priv;
struct lttng_kernel_event_notifier *event_notifier;
+ struct lttng_kernel_event_common_private *event_priv;
desc = probe_desc->event_desc[i];
if (!lttng_desc_match_enabler(desc,
head = utils_borrow_hash_table_bucket(
event_notifier_group->events_ht.table,
LTTNG_EVENT_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->parent.user_token)
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ if (event_priv->desc == desc
+ && event_priv->user_token == event_notifier_enabler->parent.user_token)
found = 1;
}
if (found)
const struct lttng_kernel_event_desc *desc = table[i].desc;
struct lttng_event_recorder_enabler *event_enabler;
struct lttng_kernel_abi_event ev;
- struct lttng_kernel_event_recorder_private *event_recorder_priv;
struct lttng_kernel_event_recorder *event_recorder;
+ struct lttng_kernel_event_common_private *event_priv;
struct hlist_head *head;
bool found = false;
head = utils_borrow_hash_table_bucket(
session->priv->events_ht.table, LTTNG_EVENT_HT_SIZE,
desc->event_name);
- lttng_hlist_for_each_entry(event_recorder_priv, head, hlist) {
- if (event_recorder_priv->parent.desc == desc
- && get_syscall_table_from_event(event_recorder_priv->parent.pub) == syscall_table)
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ if (event_priv->desc == desc
+ && get_syscall_table_from_event(event_priv->pub) == syscall_table)
found = true;
}
if (found)
struct lttng_event_notifier_enabler *event_notifier_enabler,
enum sc_type type)
{
- struct lttng_kernel_event_notifier_private *event_notifier_priv;
+ struct lttng_kernel_event_common_private *event_priv;
struct lttng_kernel_event_notifier *event_notifier;
const struct lttng_kernel_event_desc *desc;
struct lttng_event_notifier_group *group = event_notifier_enabler->group;
*/
head = utils_borrow_hash_table_bucket(group->events_ht.table,
LTTNG_EVENT_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 == base_enabler->user_token)
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ if (event_priv->desc == desc &&
+ event_priv->user_token == base_enabler->user_token)
found = true;
}
if (found)
/* iterate over all syscall and create event_notifier that match */
for (i = 0; i < table_len; i++) {
struct lttng_event_notifier_enabler *event_notifier_enabler;
- struct lttng_kernel_event_notifier_private *event_notifier_priv;
+ struct lttng_kernel_event_common_private *event_priv;
struct lttng_kernel_event_notifier *event_notifier;
struct lttng_kernel_abi_event_notifier event_notifier_param;
struct hlist_head *head;
*/
head = utils_borrow_hash_table_bucket(group->events_ht.table,
LTTNG_EVENT_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 == syscall_event_notifier_enabler->parent.user_token)
+ lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
+ if (event_priv->desc == desc
+ && event_priv->user_token == syscall_event_notifier_enabler->parent.user_token)
found = 1;
}
if (found)