#include <urcu/hlist.h>
#include <urcu/uatomic.h>
#include <urcu/compiler.h>
+#include <urcu/system.h>
#include <lttng/tracepoint.h>
#include <lttng/ust-abi.h> /* for LTTNG_UST_SYM_NAME_LEN */
* is used.
*/
rcu_assign_pointer(elem->probes, (*entry)->probes);
- elem->state = active;
+ CMM_STORE_SHARED(elem->state, active);
}
/*
*/
static void disable_tracepoint(struct tracepoint *elem)
{
- elem->state = 0;
+ CMM_STORE_SHARED(elem->state, 0);
rcu_assign_pointer(elem->probes, NULL);
}
hash = jhash(name, name_len, 0);
head = &callsite_table[hash & (CALLSITE_TABLE_SIZE - 1)];
e = zmalloc(sizeof(struct callsite_entry));
- assert(e);
+ if (!e) {
+ PERROR("Unable to add callsite for tracepoint \"%s\"", name);
+ return;
+ }
cds_hlist_add_head(&e->hlist, head);
e->tp = tp;
cds_list_add(&e->node, &lib->callsites);
init_tracepoint();
pl = (struct tracepoint_lib *) zmalloc(sizeof(struct tracepoint_lib));
-
+ if (!pl) {
+ PERROR("Unable to register tracepoint lib");
+ return -1;
+ }
pl->tracepoints_start = tracepoints_start;
pl->tracepoints_count = tracepoints_count;
CDS_INIT_LIST_HEAD(&pl->callsites);