Tracepoint API namespacing ust-endian
[lttng-ust.git] / src / lib / lttng-ust-ctl / ustctl.c
index 4b0e3f76b2e56e3bb8332c1da1d5115ce3a022b7..137bf43347d16f0c7dd81776b29590cfdfd72282 100644 (file)
@@ -16,6 +16,7 @@
 #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"
@@ -32,7 +33,7 @@
 #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"
 
 /*
@@ -2124,11 +2125,11 @@ int ustctl_recv_reg_msg(int sock,
                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;
        }
@@ -2534,7 +2535,7 @@ int ustctl_regenerate_statedump(int sock, int handle)
 
 int ustctl_get_nr_cpu_per_counter(void)
 {
-       return lttng_counter_num_possible_cpus();
+       return num_possible_cpus();
 }
 
 struct ustctl_daemon_counter *
@@ -2901,13 +2902,16 @@ int ustctl_counter_clear(struct ustctl_daemon_counter *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();
This page took 0.024865 seconds and 4 git commands to generate.