Combine common code across notifier and recorder.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I1b781cf0481cc6d532622975376cc834d1b33603
struct lttng_counter_ops *ops;
};
-#define LTTNG_EVENT_NOTIFIER_HT_BITS 12
-#define LTTNG_EVENT_NOTIFIER_HT_SIZE (1U << LTTNG_EVENT_NOTIFIER_HT_BITS)
+#define LTTNG_EVENT_HT_BITS 12
+#define LTTNG_EVENT_HT_SIZE (1U << LTTNG_EVENT_HT_BITS)
-struct lttng_event_notifier_ht {
- struct hlist_head table[LTTNG_EVENT_NOTIFIER_HT_SIZE];
+struct lttng_event_ht {
+ struct hlist_head table[LTTNG_EVENT_HT_SIZE];
};
struct lttng_event_notifier_group {
struct list_head node; /* event notifier group list */
struct list_head enablers_head; /* List of enablers */
struct list_head event_notifiers_head; /* List of event notifier */
- struct lttng_event_notifier_ht event_notifiers_ht; /* Hash table of event notifiers */
+ struct lttng_event_ht events_ht; /* Hash table of event notifiers */
struct lttng_kernel_channel_buffer_ops *ops;
struct lttng_transport *transport;
struct lttng_kernel_ring_buffer_channel *chan; /* Ring buffer channel for event notifier group. */
struct lttng_counter_ops ops;
};
-#define LTTNG_EVENT_HT_BITS 12
-#define LTTNG_EVENT_HT_SIZE (1U << LTTNG_EVENT_HT_BITS)
-
-struct lttng_event_ht {
- struct hlist_head table[LTTNG_EVENT_HT_SIZE];
-};
-
struct lttng_kernel_session_private {
struct lttng_kernel_session *pub; /* Public session interface */
INIT_LIST_HEAD(&event_notifier_group->enablers_head);
INIT_LIST_HEAD(&event_notifier_group->event_notifiers_head);
- for (i = 0; i < LTTNG_EVENT_NOTIFIER_HT_SIZE; i++)
- INIT_HLIST_HEAD(&event_notifier_group->event_notifiers_ht.table[i]);
+ for (i = 0; i < LTTNG_EVENT_HT_SIZE; i++)
+ INIT_HLIST_HEAD(&event_notifier_group->events_ht.table[i]);
list_add(&event_notifier_group->node, &event_notifier_groups);
goto type_error;
}
- head = utils_borrow_hash_table_bucket(event_notifier_group->event_notifiers_ht.table,
- LTTNG_EVENT_NOTIFIER_HT_SIZE, event_name);
+ 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,
* Check if already created.
*/
head = utils_borrow_hash_table_bucket(
- event_notifier_group->event_notifiers_ht.table,
- LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
+ 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)
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(group->event_notifiers_ht.table,
- LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
+ 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)
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(group->event_notifiers_ht.table,
- LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
+ 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 == event_notifier_enabler->parent.user_token)