X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=liblttng-ust%2Flttng-ust-abi.c;h=ff3aab5313cbc7c0f7bb68a189794b7208cbcb8a;hb=04a351cb408ea9e5b60f5f97ed841d87421529b2;hp=0d2058a3f5947b24eb604c88a0f1c5a20e880a1b;hpb=ebabbf580131acd1fe246c4d31fc5c044d36a038;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index 0d2058a3..ff3aab53 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -57,6 +57,7 @@ #include "../libringbuffer/frontend_types.h" #include "../libringbuffer/shm.h" #include "../libcounter/counter.h" +#include "tracepoint-internal.h" #include "lttng-tracer.h" #include "string-utils.h" #include "ust-events-internal.h" @@ -438,7 +439,7 @@ long lttng_cmd(int objd, unsigned int cmd, unsigned long arg, case LTTNG_UST_TRACEPOINT_FIELD_LIST: return lttng_abi_tracepoint_field_list(owner); case LTTNG_UST_WAIT_QUIESCENT: - synchronize_trace(); + lttng_ust_synchronize_trace(); return 0; case LTTNG_UST_EVENT_NOTIFIER_GROUP_CREATE: return lttng_abi_event_notifier_send_fd(owner, @@ -452,6 +453,7 @@ static const struct lttng_ust_objd_ops lttng_ops = { .cmd = lttng_cmd, }; +static int lttng_abi_map_channel(int session_objd, struct lttng_ust_channel *ust_chan, union ust_args *uargs, @@ -815,10 +817,10 @@ int lttng_ust_event_notifier_group_create_error_counter(int event_notifier_group return -EINVAL; switch (error_counter_conf->bitness) { - case LTTNG_UST_COUNTER_BITNESS_64BITS: + case LTTNG_UST_COUNTER_BITNESS_64: counter_transport_name = "counter-per-cpu-64-modular"; break; - case LTTNG_UST_COUNTER_BITNESS_32BITS: + case LTTNG_UST_COUNTER_BITNESS_32: counter_transport_name = "counter-per-cpu-32-modular"; break; default: @@ -845,8 +847,16 @@ int lttng_ust_event_notifier_group_create_error_counter(int event_notifier_group goto create_error; } - event_notifier_group->error_counter = counter; event_notifier_group->error_counter_len = counter_len; + /* + * store-release to publish error counter matches load-acquire + * in record_error. Ensures the counter is created and the + * error_counter_len is set before they are used. + * Currently a full memory barrier is used, which could be + * turned into acquire-release barriers. + */ + cmm_smp_mb(); + CMM_STORE_SHARED(event_notifier_group->error_counter, counter); counter->objd = counter_objd; counter->event_notifier_group = event_notifier_group; /* owner */