_TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)();
ret = lttng_probe_register(&_TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER));
if (ret) {
- fprintf(stderr, "LTTng-UST: Error (%d) while registering tracepoint probe. Duplicate registration of tracepoint probes having the same name is not allowed.\n", ret);
+ fprintf(stderr, "LTTng-UST: Error (%d) while registering tracepoint probe.\n", ret);
abort();
}
}
struct lttng_event *event;
struct lttng_session *session = chan->session;
struct cds_hlist_head *head;
- struct cds_hlist_node *node;
int ret = 0;
size_t name_len = strlen(event_name);
uint32_t hash;
hash = jhash(event_name, name_len, 0);
head = &chan->session->events_ht.table[hash & (LTTNG_UST_EVENT_HT_SIZE - 1)];
- cds_hlist_for_each_entry(event, node, head, hlist) {
- assert(event->desc);
- if (!strncmp(event->desc->name, desc->name,
- LTTNG_UST_SYM_NAME_LEN - 1)
- && chan == event->chan) {
- ret = -EEXIST;
- goto exist;
- }
- }
notify_socket = lttng_get_notify_socket(session->owner);
if (notify_socket < 0) {
cache_error:
create_enum_error:
socket_error:
-exist:
return ret;
}
return &_probe_list;
}
-static
-const struct lttng_probe_desc *find_provider(const char *provider)
-{
- struct lttng_probe_desc *iter;
- struct cds_list_head *probe_list;
-
- probe_list = lttng_get_probe_list_head();
- cds_list_for_each_entry(iter, probe_list, head) {
- if (!strcmp(iter->provider, provider))
- return iter;
- }
- return NULL;
-}
-
static
int check_provider_version(struct lttng_probe_desc *desc)
{
ust_lock_nocheck();
- /*
- * Check if the provider has already been registered.
- */
- if (find_provider(desc->provider)) {
- ret = -EEXIST;
- goto end;
- }
cds_list_add(&desc->lazy_init_head, &lazy_probe_init);
desc->lazy = 1;
DBG("adding probe %s containing %u events to lazy registration list",
*/
if (lttng_session_active())
fixup_lazy_probes();
-end:
+
ust_unlock();
return ret;
}