struct lttng_event_enabler_common *enabler);
bool lttng_event_enabler_match_event(struct lttng_event_enabler_common *event_enabler,
struct lttng_kernel_event_common *event);
-bool lttng_event_enabler_desc_match_event(struct lttng_event_enabler_common *event_enabler,
- const struct lttng_kernel_event_desc *desc,
- struct lttng_kernel_event_common *event);
bool lttng_event_enabler_event_name_match_event(struct lttng_event_enabler_common *event_enabler,
const char *event_name,
struct lttng_kernel_event_common *event);
struct lttng_kernel_channel_counter *lttng_kernel_alloc_channel_counter(void);
void lttng_kernel_free_channel_common(struct lttng_kernel_channel_common *chan);
+int format_event_key(struct lttng_event_enabler_common *event_enabler, char *key_string,
+ const char *event_name);
+bool lttng_event_enabler_event_name_key_match_event(struct lttng_event_enabler_common *event_enabler,
+ const char *event_name, const char *key_string, struct lttng_kernel_event_common *event);
+
#define lttng_kernel_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv) \
__LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, { \
.event_field = (_event_field), \
}
}
-static
int format_event_key(struct lttng_event_enabler_common *event_enabler, char *key_string,
const char *event_name)
{
return false;
}
-static
bool lttng_event_enabler_event_name_key_match_event(struct lttng_event_enabler_common *event_enabler,
const char *event_name, const char *key_string, struct lttng_kernel_event_common *event)
{
}
}
-bool lttng_event_enabler_desc_match_event(struct lttng_event_enabler_common *event_enabler,
- const struct lttng_kernel_event_desc *desc,
- struct lttng_kernel_event_common *event)
-{
- if (event_enabler->event_param.instrumentation != event->priv->instrumentation)
- return false;
-
- 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.parent);
- struct lttng_kernel_event_recorder *event_recorder =
- container_of(event, struct lttng_kernel_event_recorder, parent);
-
- if (event->priv->desc == desc && event_recorder->chan == event_recorder_enabler->chan)
- return true;
- else
- return false;
- }
- //TODO: LTTNG_EVENT_ENABLER_TYPE_COUNTER
- case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
- {
- struct lttng_event_notifier_enabler *event_notifier_enabler =
- container_of(event_enabler, struct lttng_event_notifier_enabler, parent);
- struct lttng_kernel_event_notifier *event_notifier =
- container_of(event, struct lttng_kernel_event_notifier, parent);
-
- if (event->priv->desc == desc
- && event_notifier->priv->group == event_notifier_enabler->group
- && event->priv->user_token == event_enabler->user_token)
- return true;
- else
- return false;
- }
- default:
- WARN_ON_ONCE(1);
- return false;
- }
-}
-
bool lttng_event_enabler_event_name_match_event(struct lttng_event_enabler_common *event_enabler,
const char *event_name,
struct lttng_kernel_event_common *event)
#endif
/* iterate over all syscall and create event that match */
for (i = 0; i < table_len; i++) {
+ char key_string[LTTNG_KEY_TOKEN_STRING_LEN_MAX] = { 0 };
struct lttng_kernel_event_common_private *event_priv;
struct hlist_head *head;
bool found = false;
if (!lttng_desc_match_enabler(desc, syscall_event_enabler_common))
continue;
+ if (format_event_key(syscall_event_enabler_common, key_string, desc->event_name))
+ continue;
+
/*
* Check if already created.
*/
head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, desc->event_name);
lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
- if (lttng_event_enabler_desc_match_event(syscall_event_enabler_common, desc, event_priv->pub)) {
+ if (lttng_event_enabler_event_name_key_match_event(syscall_event_enabler_common, desc->event_name, key_string, event_priv->pub)) {
found = true;
break;
}
static
void create_unknown_syscall_event(struct lttng_event_enabler_common *event_enabler, enum sc_type type)
{
+ char key_string[LTTNG_KEY_TOKEN_STRING_LEN_MAX] = { 0 };
struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(event_enabler);
struct lttng_kernel_event_common_private *event_priv;
const struct lttng_kernel_event_desc *desc;
WARN_ON_ONCE(1);
}
+ if (format_event_key(event_enabler, key_string, desc->event_name))
+ return;
+
/*
* Check if already created.
*/
head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, desc->event_name);
lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
- if (lttng_event_enabler_desc_match_event(event_enabler, desc, event_priv->pub)) {
+ if (lttng_event_enabler_event_name_key_match_event(event_enabler, desc->event_name, key_string, event_priv->pub)) {
found = true;
break;
}