return &event_notifier_enabler->parent;
}
+static inline
+struct lttng_event_ht *lttng_get_event_ht_from_enabler(struct lttng_event_enabler_common *event_enabler)
+{
+ 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);
+ return &event_recorder_enabler->chan->parent.session->priv->events_ht;
+ }
+ case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
+ {
+ struct lttng_event_notifier_enabler *event_notifier_enabler =
+ container_of(event_enabler, struct lttng_event_notifier_enabler, parent);
+ return &event_notifier_enabler->group->events_ht;
+ }
+ default:
+ return NULL;
+ }
+}
+
int lttng_context_init(void);
void lttng_context_exit(void);
int lttng_kernel_context_append(struct lttng_kernel_ctx **ctx_p,
struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
const struct lttng_kernel_event_desc *event_desc)
{
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_enabler->parent);
struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
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;
struct lttng_kernel_event_recorder_private *event_recorder_priv;
struct lttng_kernel_event_common_private *event_priv;
goto type_error;
}
- head = utils_borrow_hash_table_bucket(session->priv->events_ht.table,
- LTTNG_EVENT_HT_SIZE, event_name);
+ head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, 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);
struct lttng_kernel_event_notifier *_lttng_event_notifier_create(struct lttng_event_notifier_enabler *event_enabler,
const struct lttng_kernel_event_desc *event_desc)
{
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_enabler->parent);
struct lttng_event_notifier_group *event_notifier_group = event_enabler->group;
struct lttng_kernel_abi_event *event_param = &event_enabler->parent.event_param;
uint64_t token = event_enabler->parent.user_token;
goto type_error;
}
- head = utils_borrow_hash_table_bucket(event_notifier_group->events_ht.table,
- LTTNG_EVENT_HT_SIZE, event_name);
+ head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, 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);
static
void lttng_create_tracepoint_event_if_missing(struct lttng_event_recorder_enabler *event_enabler)
{
- struct lttng_kernel_session *session = event_enabler->chan->parent.session;
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_enabler->parent);
struct lttng_kernel_probe_desc *probe_desc;
const struct lttng_kernel_event_desc *desc;
int i;
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(
- session->priv->events_ht.table, LTTNG_EVENT_HT_SIZE,
- desc->event_name);
+ 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) {
event_recorder_priv = container_of(event_priv, struct lttng_kernel_event_recorder_private, parent);
if (event_priv->desc == desc
static
void lttng_create_tracepoint_event_notifier_if_missing(struct lttng_event_notifier_enabler *event_notifier_enabler)
{
- struct lttng_event_notifier_group *event_notifier_group = event_notifier_enabler->group;
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_notifier_enabler->parent);
struct lttng_kernel_probe_desc *probe_desc;
const struct lttng_kernel_event_desc *desc;
int i;
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(
- event_notifier_group->events_ht.table,
+ 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 (event_priv->desc == desc
struct hlist_head *chan_table, struct lttng_event_recorder_enabler *syscall_event_enabler,
enum sc_type type)
{
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&syscall_event_enabler->parent);
struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(&syscall_event_enabler->parent);
struct lttng_kernel_channel_buffer *chan = syscall_event_enabler->chan;
- struct lttng_kernel_session *session = chan->parent.session;
unsigned int i;
/* Allocate events for each syscall matching enabler, insert into table */
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(
- session->priv->events_ht.table, LTTNG_EVENT_HT_SIZE,
- desc->event_name);
+ 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 (event_priv->desc == desc
&& get_syscall_table_from_event(event_priv->pub) == syscall_table)
struct lttng_event_notifier_enabler *event_notifier_enabler,
enum sc_type type)
{
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_notifier_enabler->parent);
struct lttng_kernel_event_common_private *event_priv;
struct lttng_kernel_event_notifier *event_notifier;
const struct lttng_kernel_event_desc *desc;
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(group->events_ht.table,
- LTTNG_EVENT_HT_SIZE, desc->event_name);
+ 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 (event_priv->desc == desc &&
event_priv->user_token == base_enabler->user_token)
const struct trace_syscall_entry *table,
size_t table_len, enum sc_type type)
{
+ struct lttng_event_ht *events_ht = lttng_get_event_ht_from_enabler(&syscall_event_notifier_enabler->parent);
struct lttng_event_notifier_group *group = syscall_event_notifier_enabler->group;
const struct lttng_kernel_event_desc *desc;
uint64_t user_token = syscall_event_notifier_enabler->parent.user_token;
/*
* Check if already created.
*/
- head = utils_borrow_hash_table_bucket(group->events_ht.table,
- LTTNG_EVENT_HT_SIZE, desc->event_name);
+ 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 (event_priv->desc == desc
&& event_priv->user_token == syscall_event_notifier_enabler->parent.user_token)