int lttng_probe_register(struct lttng_probe_desc *desc);
void lttng_probe_unregister(struct lttng_probe_desc *desc);
-int lttng_fix_pending_event_desc(const struct lttng_event_desc *desc);
+int lttng_fix_pending_events(void);
int lttng_probes_init(void);
void lttng_probes_exit(void);
int lttng_find_context(struct lttng_ctx *ctx, const char *name);
/*
* Called at library load: connect the probe on all enablers matching
* this event.
- * called with session mutex held.
- * TODO: currently, for each desc added, we iterate on all event desc
- * (inefficient). We should create specific code that only target the
- * added desc.
+ * Called with session mutex held.
*/
-int lttng_fix_pending_event_desc(const struct lttng_event_desc *desc)
+int lttng_fix_pending_events(void)
{
struct lttng_session *session;
{
struct lttng_probe_desc *iter;
struct cds_list_head *probe_list;
- int i;
/*
* Each provider enforce that every event name begins with the
desc_added:
DBG("just registered probe %s containing %u events",
desc->provider, desc->nr_events);
- /*
- * fix the events awaiting probe load.
- */
- for (i = 0; i < desc->nr_events; i++) {
- const struct lttng_event_desc *ed;
- int ret;
-
- ed = desc->event_desc[i];
- DBG("Registered event probe \"%s\" with signature \"%s\"",
- ed->name, ed->signature);
- ret = lttng_fix_pending_event_desc(ed);
- assert(!ret);
- }
}
/*
void fixup_lazy_probes(void)
{
struct lttng_probe_desc *iter, *tmp;
+ int ret;
lazy_nesting++;
cds_list_for_each_entry_safe(iter, tmp,
iter->lazy = 0;
cds_list_del(&iter->lazy_init_head);
}
+ ret = lttng_fix_pending_events();
+ assert(!ret);
lazy_nesting--;
}