Introduce the relayd socket object
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.h
index 6350fd1e32280424c17b97fa4d7bcc3457d3e346..ebb896b585e6fb759a9ea0c85f32c801f4d94ec2 100644 (file)
@@ -138,6 +138,24 @@ enum lttcomm_sock_domain {
        LTTCOMM_INET6     = 1,
 };
 
+enum lttcomm_metadata_command {
+       LTTCOMM_METADATA_REQUEST = 1,
+};
+
+/*
+ * Commands sent from the consumerd to the sessiond to request if new metadata
+ * is available. This message is used to find the per UID _or_ per PID registry
+ * for the channel key. For per UID lookup, the triplet
+ * bits_per_long/uid/session_id is used. On lookup failure, we search for the
+ * per PID registry indexed by session id ignoring the other values.
+ */
+struct lttcomm_metadata_request_msg {
+       unsigned int session_id; /* Tracing session id */
+       uint32_t bits_per_long; /* Consumer ABI */
+       uint32_t uid;
+       uint64_t key; /* Metadata channel key. */
+} LTTNG_PACKED;
+
 struct lttcomm_sockaddr {
        enum lttcomm_sock_domain type;
        union {
@@ -153,6 +171,16 @@ struct lttcomm_sock {
        const struct lttcomm_proto_ops *ops;
 } LTTNG_PACKED;
 
+/*
+ * Relayd sock. Adds the protocol version to use for the communications with
+ * the relayd.
+ */
+struct lttcomm_relayd_sock {
+       struct lttcomm_sock sock;
+       uint32_t major;
+       uint32_t minor;
+} LTTNG_PACKED;
+
 struct lttcomm_net_family {
        int family;
        int (*create) (struct lttcomm_sock *sock, int type, int proto);
@@ -273,6 +301,8 @@ struct lttcomm_consumer_msg {
                        /* Use splice or mmap to consume this fd */
                        enum lttng_event_output output;
                        int type; /* Per cpu or metadata. */
+                       uint64_t tracefile_size; /* bytes */
+                       uint32_t tracefile_count; /* number of tracefiles */
                } LTTNG_PACKED channel; /* Only used by Kernel. */
                struct {
                        uint64_t stream_key;
@@ -283,7 +313,7 @@ struct lttcomm_consumer_msg {
                        uint64_t net_index;
                        enum lttng_stream_type type;
                        /* Open socket to the relayd */
-                       struct lttcomm_sock sock;
+                       struct lttcomm_relayd_sock sock;
                        /* Tracing session id associated to the relayd. */
                        uint64_t session_id;
                } LTTNG_PACKED relayd_sock;
@@ -310,6 +340,8 @@ struct lttcomm_consumer_msg {
                        uint64_t key;                           /* Unique channel key. */
                        unsigned char uuid[UUID_STR_LEN];       /* uuid for ust tracer. */
                        uint32_t chan_id;                       /* Channel ID on the tracer side. */
+                       uint64_t tracefile_size;        /* bytes */
+                       uint32_t tracefile_count;       /* number of tracefiles */
                } LTTNG_PACKED ask_channel;
                struct {
                        uint64_t key;
@@ -403,4 +435,8 @@ extern struct lttcomm_sock *lttcomm_alloc_copy_sock(struct lttcomm_sock *src);
 extern void lttcomm_copy_sock(struct lttcomm_sock *dst,
                struct lttcomm_sock *src);
 
+/* Relayd socket object. */
+extern struct lttcomm_relayd_sock *lttcomm_alloc_relayd_sock(
+               struct lttng_uri *uri, uint32_t major, uint32_t minor);
+
 #endif /* _LTTNG_SESSIOND_COMM_H */
This page took 0.024405 seconds and 4 git commands to generate.