Tests: Fix abi conflict test when building with clang
[lttng-ust.git] / src / common / ustcomm.h
index 81ce885dc460cb76b3eb6208627f3ece0009757d..7ecb365be78f16b853f763755f6e6b5c91ad6d57 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * SPDX-License-Identifier: LGPL-2.1-only
  *
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
- * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
  * These declarations should NOT be considered stable API.
  */
 
-#ifndef _UST_COMMON_USTCOMM_H
-#define _UST_COMMON_USTCOMM_H
+#ifndef _UST_COMMON_UST_COMM_H
+#define _UST_COMMON_UST_COMM_H
 
 #include <stdint.h>
 #include <limits.h>
 #include <unistd.h>
 #include <lttng/ust-abi.h>
+#include <lttng/ust-abi-old.h>
 #include <lttng/ust-error.h>
 #include <lttng/ust-compiler.h>
 #include <lttng/ust-ctl.h>
@@ -43,7 +43,7 @@ struct lttng_ust_enum_entry;
 struct lttng_integer_type;
 struct lttng_ust_session;
 
-struct ustctl_reg_msg {
+struct lttng_ust_ctl_reg_msg {
        uint32_t magic;
        uint32_t major;
        uint32_t minor;
@@ -57,7 +57,7 @@ struct ustctl_reg_msg {
        uint32_t uint32_t_alignment;
        uint32_t uint64_t_alignment;
        uint32_t long_alignment;
-       uint32_t socket_type;                   /* enum ustctl_socket_type */
+       uint32_t socket_type;                   /* enum lttng_ust_ctl_socket_type */
        char name[LTTNG_UST_ABI_PROCNAME_LEN];  /* process name */
        char padding[LTTNG_UST_COMM_REG_MSG_PADDING];
 } __attribute__((packed));
@@ -91,18 +91,12 @@ struct ustcomm_ust_msg {
                        uint32_t reloc_offset;
                        uint64_t seqnum;
                } __attribute__((packed)) capture;
-               struct lttng_ust_abi_counter counter;
-               struct lttng_ust_abi_counter_global counter_global;
-               struct lttng_ust_abi_counter_cpu counter_cpu;
-               /*
-                * For lttng_ust_abi_EVENT_NOTIFIER_CREATE, a struct
-                * lttng_ust_abi_event_notifier implicitly follows struct
-                * ustcomm_ust_msg.
-                */
+               struct lttng_ust_abi_old_counter counter_old;
+               struct lttng_ust_abi_old_counter_global counter_global_old;
+               struct lttng_ust_abi_old_counter_cpu counter_cpu_old;
                struct {
-                       /* Length of struct lttng_ust_abi_event_notifier */
-                       uint32_t len;
-               } event_notifier;
+                       uint32_t cmd_len;
+               } __attribute__((packed)) var_len_cmd;
                char padding[USTCOMM_MSG_PADDING2];
        } u;
 } __attribute__((packed));
@@ -136,7 +130,7 @@ struct ustcomm_notify_hdr {
        uint32_t notify_cmd;
 } __attribute__((packed));
 
-#define USTCOMM_NOTIFY_EVENT_MSG_PADDING       32
+#define USTCOMM_NOTIFY_EVENT_MSG_PADDING       24
 struct ustcomm_notify_event_msg {
        uint32_t session_objd;
        uint32_t channel_objd;
@@ -145,6 +139,7 @@ struct ustcomm_notify_event_msg {
        uint32_t signature_len;
        uint32_t fields_len;
        uint32_t model_emf_uri_len;
+       uint64_t user_token;
        char padding[USTCOMM_NOTIFY_EVENT_MSG_PADDING];
        /* followed by signature, fields, and model_emf_uri */
 } __attribute__((packed));
@@ -152,10 +147,28 @@ struct ustcomm_notify_event_msg {
 #define USTCOMM_NOTIFY_EVENT_REPLY_PADDING     32
 struct ustcomm_notify_event_reply {
        int32_t ret_code;       /* 0: ok, negative: error code */
-       uint32_t event_id;
+       uint32_t id;    /* 32-bit event id. */
        char padding[USTCOMM_NOTIFY_EVENT_REPLY_PADDING];
 } __attribute__((packed));
 
+#define USTCOMM_NOTIFY_KEY_MSG_PADDING 24
+struct ustcomm_notify_key_msg {
+       uint32_t session_objd;
+       uint32_t map_objd;
+       uint32_t dimension;
+       uint32_t key_string_len;
+       uint64_t user_token;
+       char padding[USTCOMM_NOTIFY_KEY_MSG_PADDING];
+       /* followed by dimension_indexes (array of @dimension uint64_t items) and key_string. */
+} __attribute__((packed));
+
+#define USTCOMM_NOTIFY_KEY_REPLY_PADDING       32
+struct ustcomm_notify_key_reply {
+       int32_t ret_code;       /* 0: ok, negative: error code */
+       uint64_t index;         /* 64-bit key index. */
+       char padding[USTCOMM_NOTIFY_KEY_REPLY_PADDING];
+} __attribute__((packed));
+
 #define USTCOMM_NOTIFY_ENUM_MSG_PADDING                32
 struct ustcomm_notify_enum_msg {
        uint32_t session_objd;
@@ -165,11 +178,11 @@ struct ustcomm_notify_enum_msg {
        /* followed by enum entries */
 } __attribute__((packed));
 
-#define USTCOMM_NOTIFY_EVENT_REPLY_PADDING     32
+#define USTCOMM_NOTIFY_ENUM_REPLY_PADDING      32
 struct ustcomm_notify_enum_reply {
        int32_t ret_code;       /* 0: ok, negative: error code */
        uint64_t enum_id;
-       char padding[USTCOMM_NOTIFY_EVENT_REPLY_PADDING];
+       char padding[USTCOMM_NOTIFY_ENUM_REPLY_PADDING];
 } __attribute__((packed));
 
 #define USTCOMM_NOTIFY_CHANNEL_MSG_PADDING     32
@@ -185,7 +198,7 @@ struct ustcomm_notify_channel_msg {
 struct ustcomm_notify_channel_reply {
        int32_t ret_code;       /* 0: ok, negative: error code */
        uint32_t chan_id;
-       uint32_t header_type;   /* enum ustctl_channel_header */
+       uint32_t header_type;   /* enum lttng_ust_ctl_channel_header */
        char padding[USTCOMM_NOTIFY_CHANNEL_REPLY_PADDING];
 } __attribute__((packed));
 
@@ -207,6 +220,9 @@ int ustcomm_accept_unix_sock(int sock)
 int ustcomm_listen_unix_sock(int sock)
        __attribute__((visibility("hidden")));
 
+int ustcomm_shutdown_unix_sock(int sock)
+       __attribute__((visibility("hidden")));
+
 int ustcomm_close_unix_sock(int sock)
        __attribute__((visibility("hidden")));
 
@@ -253,8 +269,8 @@ ssize_t ustcomm_recv_event_notifier_notif_fd_from_sessiond(int sock,
                int *event_notifier_notif_fd)
        __attribute__((visibility("hidden")));
 
-ssize_t ustcomm_recv_counter_from_sessiond(int sock,
-               void **counter_data, uint64_t len)
+ssize_t ustcomm_recv_var_len_cmd_from_sessiond(int sock,
+               void **data, uint32_t len)
        __attribute__((visibility("hidden")));
 
 int ustcomm_recv_counter_shm_from_sessiond(int sock,
@@ -266,13 +282,14 @@ int ustcomm_recv_counter_shm_from_sessiond(int sock,
  * Returns -EPIPE or -ECONNRESET if other end has hung up.
  */
 int ustcomm_send_reg_msg(int sock,
-               enum ustctl_socket_type type,
+               enum lttng_ust_ctl_socket_type type,
                uint32_t bits_per_long,
                uint32_t uint8_t_alignment,
                uint32_t uint16_t_alignment,
                uint32_t uint32_t_alignment,
                uint32_t uint64_t_alignment,
-               uint32_t long_alignment)
+               uint32_t long_alignment,
+               const char *procname)
        __attribute__((visibility("hidden")));
 
 /*
@@ -287,9 +304,24 @@ int ustcomm_register_event(int sock,
        int loglevel,
        const char *signature,          /* event signature (input) */
        size_t nr_fields,               /* fields */
-       const struct lttng_ust_event_field **fields,
+       const struct lttng_ust_event_field * const *fields,
        const char *model_emf_uri,
-       uint32_t *id)                   /* event id (output) */
+       uint64_t user_token,
+       uint32_t *id)                   /* (output) */
+       __attribute__((visibility("hidden")));
+
+/*
+ * Returns 0 on success, negative error value on error.
+ * Returns -EPIPE or -ECONNRESET if other end has hung up.
+ */
+int ustcomm_register_key(int sock,
+       int session_objd,               /* session descriptor */
+       int map_objd,                   /* map descriptor */
+       uint32_t dimension,
+       const uint64_t *dimension_indexes,
+       const char *key_string,         /* key string (input) */
+       uint64_t user_token,
+       uint64_t *index)                /* (output) */
        __attribute__((visibility("hidden")));
 
 /*
@@ -300,7 +332,7 @@ int ustcomm_register_enum(int sock,
        int session_objd,               /* session descriptor */
        const char *enum_name,          /* enum name (input) */
        size_t nr_entries,              /* entries */
-       const struct lttng_ust_enum_entry **entries,
+       const struct lttng_ust_enum_entry * const *entries,
        uint64_t *id)                   /* enum id (output) */
        __attribute__((visibility("hidden")));
 
@@ -324,4 +356,4 @@ int ustcomm_setsockopt_rcv_timeout(int sock, unsigned int msec)
 int ustcomm_setsockopt_snd_timeout(int sock, unsigned int msec)
        __attribute__((visibility("hidden")));
 
-#endif /* _UST_COMMON_USTCOMM_H */
+#endif /* _UST_COMMON_UST_COMM_H */
This page took 0.026633 seconds and 4 git commands to generate.