Move and hide new 'lttng_counter_transport_*' private symbols
[lttng-ust.git] / liblttng-ust-ctl / ustctl.c
index e7978744be681894d9cad7b769855597c09af0f1..cfff4b174a2e9c49ddf6f1e64d3fb08b85965731 100644 (file)
@@ -36,6 +36,7 @@
 #include "../liblttng-ust/lttng-rb-clients.h"
 #include "../liblttng-ust/clock.h"
 #include "../liblttng-ust/getenv.h"
+#include "../liblttng-ust/lttng-tracer-core.h"
 
 #include "../libcounter/shm.h"
 #include "../libcounter/smp.h"
@@ -99,9 +100,13 @@ extern void lttng_ring_buffer_client_overwrite_rt_exit(void);
 extern void lttng_ring_buffer_client_discard_exit(void);
 extern void lttng_ring_buffer_client_discard_rt_exit(void);
 extern void lttng_ring_buffer_metadata_client_exit(void);
+LTTNG_HIDDEN
 extern void lttng_counter_client_percpu_32_modular_init(void);
+LTTNG_HIDDEN
 extern void lttng_counter_client_percpu_32_modular_exit(void);
+LTTNG_HIDDEN
 extern void lttng_counter_client_percpu_64_modular_init(void);
+LTTNG_HIDDEN
 extern void lttng_counter_client_percpu_64_modular_exit(void);
 
 int ustctl_release_handle(int sock, int handle)
@@ -562,6 +567,7 @@ int ustctl_create_event_notifier(int sock, struct lttng_ust_event_notifier *even
        struct ustcomm_ust_msg lum;
        struct ustcomm_ust_reply lur;
        struct lttng_ust_object_data *event_notifier_data;
+       ssize_t len;
        int ret;
 
        if (!event_notifier_group || !_event_notifier_data)
@@ -576,15 +582,22 @@ int ustctl_create_event_notifier(int sock, struct lttng_ust_event_notifier *even
        memset(&lum, 0, sizeof(lum));
        lum.handle = event_notifier_group->handle;
        lum.cmd = LTTNG_UST_EVENT_NOTIFIER_CREATE;
+       lum.u.event_notifier.len = sizeof(*event_notifier);
 
-       strncpy(lum.u.event_notifier.event.name, event_notifier->event.name,
-               LTTNG_UST_SYM_NAME_LEN);
-       lum.u.event_notifier.event.instrumentation = event_notifier->event.instrumentation;
-       lum.u.event_notifier.event.loglevel_type = event_notifier->event.loglevel_type;
-       lum.u.event_notifier.event.loglevel = event_notifier->event.loglevel;
-       lum.u.event_notifier.event.token = event_notifier->event.token;
-       lum.u.event_notifier.error_counter_index = event_notifier->error_counter_index;
-       ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+       ret = ustcomm_send_app_msg(sock, &lum);
+       if (ret) {
+               free(event_notifier_data);
+               return ret;
+       }
+       /* Send struct lttng_ust_event_notifier */
+       len = ustcomm_send_unix_sock(sock, event_notifier, sizeof(*event_notifier));
+       if (len != sizeof(*event_notifier)) {
+               if (len < 0)
+                       return len;
+               else
+                       return -EIO;
+       }
+       ret = ustcomm_recv_app_reply(sock, &lur, lum.handle, lum.cmd);
        if (ret) {
                free(event_notifier_data);
                return ret;
@@ -2563,7 +2576,7 @@ int ustctl_create_counter_data(struct ustctl_daemon_counter *counter,
                struct lttng_ust_object_data **_counter_data)
 {
        struct lttng_ust_object_data *counter_data;
-       struct lttng_ust_counter_conf counter_conf;
+       struct lttng_ust_counter_conf counter_conf = {0};
        size_t i;
        int ret;
 
@@ -2579,10 +2592,10 @@ int ustctl_create_counter_data(struct ustctl_daemon_counter *counter,
        }
        switch (counter->attr->bitness) {
        case USTCTL_COUNTER_BITNESS_32:
-               counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_32BITS;
+               counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_32;
                break;
        case USTCTL_COUNTER_BITNESS_64:
-               counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_64BITS;
+               counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_64;
                break;
        default:
                return -EINVAL;
This page took 0.025157 seconds and 4 git commands to generate.