X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Ftracepoint.c;h=b966d76b1b72c8fea43f74ac8bbcb1364aed5de2;hb=25cff019d711338b8a7efe1cc54e4b1870157348;hp=f65097f6aaa92cc640eab93751847d32abf9556d;hpb=c0c0989ab70574e09b2f7e8b48c2da6af664a849;p=lttng-ust.git diff --git a/liblttng-ust/tracepoint.c b/liblttng-ust/tracepoint.c index f65097f6..b966d76b 100644 --- a/liblttng-ust/tracepoint.c +++ b/liblttng-ust/tracepoint.c @@ -21,10 +21,10 @@ #include #include -#include /* for LTTNG_UST_SYM_NAME_LEN */ +#include /* for LTTNG_UST_ABI_SYM_NAME_LEN */ #include -#include +#include #include "tracepoint-internal.h" #include "lttng-tracer-core.h" @@ -145,7 +145,7 @@ static void release_probes(void *old) if (old) { struct tp_probes *tp_probes = caa_container_of(old, struct tp_probes, probes[0]); - lttng_ust_synchronize_trace(); + lttng_ust_urcu_synchronize_rcu(); free(tp_probes); } } @@ -256,14 +256,14 @@ static struct tracepoint_entry *get_tracepoint(const char *name) size_t name_len = strlen(name); uint32_t hash; - if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) { - WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1); - name_len = LTTNG_UST_SYM_NAME_LEN - 1; + if (name_len > LTTNG_UST_ABI_SYM_NAME_LEN - 1) { + WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_ABI_SYM_NAME_LEN - 1); + name_len = LTTNG_UST_ABI_SYM_NAME_LEN - 1; } hash = jhash(name, name_len, 0); head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; cds_hlist_for_each_entry(e, node, head, hlist) { - if (!strncmp(name, e->name, LTTNG_UST_SYM_NAME_LEN - 1)) + if (!strncmp(name, e->name, LTTNG_UST_ABI_SYM_NAME_LEN - 1)) return e; } return NULL; @@ -284,14 +284,14 @@ static struct tracepoint_entry *add_tracepoint(const char *name, size_t sig_off, name_off; uint32_t hash; - if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) { - WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1); - name_len = LTTNG_UST_SYM_NAME_LEN - 1; + if (name_len > LTTNG_UST_ABI_SYM_NAME_LEN - 1) { + WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_ABI_SYM_NAME_LEN - 1); + name_len = LTTNG_UST_ABI_SYM_NAME_LEN - 1; } hash = jhash(name, name_len, 0); head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)]; cds_hlist_for_each_entry(e, node, head, hlist) { - if (!strncmp(name, e->name, LTTNG_UST_SYM_NAME_LEN - 1)) { + if (!strncmp(name, e->name, LTTNG_UST_ABI_SYM_NAME_LEN - 1)) { DBG("tracepoint %s busy", name); return ERR_PTR(-EEXIST); /* Already there */ } @@ -339,7 +339,7 @@ static void remove_tracepoint(struct tracepoint_entry *e) static void set_tracepoint(struct tracepoint_entry **entry, struct lttng_ust_tracepoint *elem, int active) { - WARN_ON(strncmp((*entry)->name, elem->name, LTTNG_UST_SYM_NAME_LEN - 1) != 0); + WARN_ON(strncmp((*entry)->name, elem->name, LTTNG_UST_ABI_SYM_NAME_LEN - 1) != 0); /* * Check that signatures match before connecting a probe to a * tracepoint. Warn the user if they don't. @@ -394,9 +394,9 @@ static void add_callsite(struct tracepoint_lib * lib, struct lttng_ust_tracepoin uint32_t hash; struct tracepoint_entry *tp_entry; - if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) { - WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1); - name_len = LTTNG_UST_SYM_NAME_LEN - 1; + if (name_len > LTTNG_UST_ABI_SYM_NAME_LEN - 1) { + WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_ABI_SYM_NAME_LEN - 1); + name_len = LTTNG_UST_ABI_SYM_NAME_LEN - 1; } hash = jhash(name, name_len, 0); head = &callsite_table[hash & (CALLSITE_TABLE_SIZE - 1)]; @@ -451,16 +451,16 @@ static void tracepoint_sync_callsites(const char *name) struct tracepoint_entry *tp_entry; tp_entry = get_tracepoint(name); - if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) { - WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1); - name_len = LTTNG_UST_SYM_NAME_LEN - 1; + if (name_len > LTTNG_UST_ABI_SYM_NAME_LEN - 1) { + WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_ABI_SYM_NAME_LEN - 1); + name_len = LTTNG_UST_ABI_SYM_NAME_LEN - 1; } hash = jhash(name, name_len, 0); head = &callsite_table[hash & (CALLSITE_TABLE_SIZE - 1)]; cds_hlist_for_each_entry(e, node, head, hlist) { struct lttng_ust_tracepoint *tp = e->tp; - if (strncmp(name, tp->name, LTTNG_UST_SYM_NAME_LEN - 1)) + if (strncmp(name, tp->name, LTTNG_UST_ABI_SYM_NAME_LEN - 1)) continue; if (tp_entry) { if (!e->tp_entry_callsite_ref) { @@ -729,7 +729,7 @@ void __tracepoint_probe_prune_release_queue(void) release_queue_need_update = 0; /* Wait for grace period between all sync_callsites and free. */ - lttng_ust_synchronize_trace(); + lttng_ust_urcu_synchronize_rcu(); cds_list_for_each_entry_safe(pos, next, &release_probes, u.list) { cds_list_del(&pos->u.list); @@ -820,7 +820,7 @@ void tracepoint_probe_update_all(void) tracepoint_update_probes(); /* Wait for grace period between update_probes and free. */ - lttng_ust_synchronize_trace(); + lttng_ust_urcu_synchronize_rcu(); cds_list_for_each_entry_safe(pos, next, &release_probes, u.list) { cds_list_del(&pos->u.list); free(pos); @@ -864,7 +864,7 @@ int tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_sta { struct tracepoint_lib *pl, *iter; - init_tracepoint(); + lttng_ust_tp_init(); pl = (struct tracepoint_lib *) zmalloc(sizeof(struct tracepoint_lib)); if (!pl) { @@ -897,7 +897,7 @@ lib_added: DBG("just registered a tracepoints section from %p and having %d tracepoints", tracepoints_start, tracepoints_count); - if (ust_debug()) { + if (ust_err_debug_enabled()) { int i; for (i = 0; i < tracepoints_count; i++) { @@ -956,15 +956,15 @@ static void check_weak_hidden(void) "DIFFERENT addresses"); } -void init_tracepoint(void) +void lttng_ust_tp_init(void) { if (uatomic_xchg(&initialized, 1) == 1) return; - init_usterr(); + ust_err_init(); check_weak_hidden(); } -void exit_tracepoint(void) +void lttng_ust_tp_exit(void) { initialized = 0; } @@ -1015,8 +1015,3 @@ int tp_get_destructors_state(void) { return uatomic_read(&tracepoint_destructors_state); } - -void lttng_ust_synchronize_trace(void) -{ - lttng_ust_urcu_synchronize_rcu(); -}