Add CTF enum type support for UST registry
[lttng-tools.git] / src / bin / lttng-sessiond / lttng-ust-ctl.h
index 7f59b86665523610b30a9d561ff326ef36521ca2..73a9244187aa9c6aef8536749439cd6482e6228b 100644 (file)
@@ -45,7 +45,7 @@ struct lttng_ust_lib_ring_buffer;
 
 struct ustctl_consumer_channel_attr {
        enum lttng_ust_chan_type type;
-       uint64_t subbuf_size;                   /* bytes */
+       uint64_t subbuf_size;                   /* bytes, power of 2 */
        uint64_t num_subbuf;                    /* power of 2 */
        int overwrite;                          /* 1: overwrite, 0: discard */
        unsigned int switch_timer_interval;     /* usec */
@@ -227,6 +227,7 @@ enum ustctl_socket_type {
 enum ustctl_notify_cmd {
        USTCTL_NOTIFY_CMD_EVENT = 0,
        USTCTL_NOTIFY_CMD_CHANNEL = 1,
+       USTCTL_NOTIFY_CMD_ENUM = 2,
 };
 
 enum ustctl_channel_header {
@@ -274,6 +275,13 @@ struct ustctl_float_type {
        char padding[USTCTL_UST_FLOAT_TYPE_PADDING];
 } LTTNG_PACKED;
 
+#define USTCTL_UST_ENUM_ENTRY_PADDING  32
+struct ustctl_enum_entry {
+       uint64_t start, end;            /* start and end are inclusive */
+       char string[LTTNG_UST_SYM_NAME_LEN];
+       char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
+};
+
 #define USTCTL_UST_BASIC_TYPE_PADDING  296
 union _ustctl_basic_type {
        struct ustctl_integer_type integer;
@@ -281,6 +289,9 @@ union _ustctl_basic_type {
                enum ustctl_string_encodings encoding;
        } string;
        struct ustctl_float_type _float;
+       struct {
+               char name[LTTNG_UST_SYM_NAME_LEN];
+       } enumeration;
        char padding[USTCTL_UST_BASIC_TYPE_PADDING];
 } LTTNG_PACKED;
 
@@ -356,7 +367,7 @@ int ustctl_recv_register_event(int sock,
                                         * event name (output,
                                         * size LTTNG_UST_SYM_NAME_LEN)
                                         */
-       int *loglevel,
+       int *loglevel_value,
        char **signature,               /*
                                         * event signature
                                         * (output, dynamically
@@ -375,6 +386,22 @@ int ustctl_reply_register_event(int sock,
        uint32_t id,                    /* event id (input) */
        int ret_code);                  /* return code. 0 ok, negative error */
 
+/*
+ * Returns 0 on success, negative UST or system error value on error.
+ */
+int ustctl_recv_register_enum(int sock,
+       int *session_objd,
+       char *enum_name,
+       struct ustctl_enum_entry **entries,
+       unsigned int *nr_entries);
+
+/*
+ * Returns 0 on success, negative error value on error.
+ */
+int ustctl_reply_register_enum(int sock,
+       int64_t id,                     /* enum id (input) */
+       int ret_code);
+
 /*
  * Returns 0 on success, negative UST or system error value on error.
  */
This page took 0.0251 seconds and 4 git commands to generate.