#include <lttng/ust-ctl.h>
#include <lttng/ust-abi.h>
#include <lttng/ust-endian.h>
+#include <lttng/ust-common.h>
#include "common/logging.h"
#include "common/ustcomm.h"
#include "lib/lttng-ust/lttng-tracer-core.h"
#include "lib/lttng-ust/lttng-counter-client.h"
-#include "common/counter/smp.h"
+#include "common/smp.h"
#include "common/counter/counter.h"
/*
return len;
if (reg_msg.magic == LTTNG_UST_ABI_COMM_MAGIC) {
- *byte_order = BYTE_ORDER == BIG_ENDIAN ?
- BIG_ENDIAN : LITTLE_ENDIAN;
- } else if (reg_msg.magic == bswap_32(LTTNG_UST_ABI_COMM_MAGIC)) {
- *byte_order = BYTE_ORDER == BIG_ENDIAN ?
- LITTLE_ENDIAN : BIG_ENDIAN;
+ *byte_order = LTTNG_UST_BYTE_ORDER == LTTNG_UST_BIG_ENDIAN ?
+ LTTNG_UST_BIG_ENDIAN : LTTNG_UST_LITTLE_ENDIAN;
+ } else if (reg_msg.magic == lttng_ust_bswap_32(LTTNG_UST_ABI_COMM_MAGIC)) {
+ *byte_order = LTTNG_UST_BYTE_ORDER == LTTNG_UST_BIG_ENDIAN ?
+ LTTNG_UST_LITTLE_ENDIAN : LTTNG_UST_BIG_ENDIAN;
} else {
return -LTTNG_UST_ERR_INVAL_MAGIC;
}
int ustctl_get_nr_cpu_per_counter(void)
{
- return lttng_counter_num_possible_cpus();
+ return num_possible_cpus();
}
struct ustctl_daemon_counter *
}
static
-void ustctl_init(void)
+void lttng_ust_ctl_ctor(void)
__attribute__((constructor));
static
-void ustctl_init(void)
+void lttng_ust_ctl_ctor(void)
{
- lttng_ust_logging_init();
- lttng_ust_getenv_init(); /* Needs lttng_ust_logging_init() to be completed. */
+ /*
+ * Call the liblttng-ust-common constructor to ensure it runs first.
+ */
+ lttng_ust_common_ctor();
+
lttng_ust_clock_init();
lttng_ust_ring_buffer_clients_init();
lttng_ust_counter_clients_init();