Cleanup: ust_session_id unused by buffer_reg_uid_consumer_channel_key
[lttng-tools.git] / src / bin / lttng-sessiond / buffer-registry.h
index 4b19f7190f17189b17ce54e3db5d368d4e5ac1e3..d0d1575fd47e478ea57b6ae91aca6af6effd3189 100644 (file)
 #define LTTNG_BUFFER_REGISTRY_H
 
 #include <stdint.h>
-#include <lttng/ust-ctl.h>
 #include <urcu/list.h>
 
 #include <lttng/lttng.h>
 #include <common/hashtable/hashtable.h>
 
 #include "consumer.h"
+#include "ust-ctl.h"
 #include "ust-registry.h"
 
 struct buffer_reg_stream {
@@ -43,10 +43,16 @@ struct buffer_reg_channel {
        uint64_t consumer_key;
        /* Stream registry object of this channel registry. */
        struct cds_list_head streams;
+       /* Total number of stream in the list. */
+       uint64_t stream_count;
        /* Used to ensure mutual exclusion to the stream's list. */
        pthread_mutex_t stream_list_lock;
        /* Node for hash table usage. */
        struct lttng_ht_node_u64 node;
+       /* Size of subbuffers in this channel. */
+       size_t subbuf_size;
+       /* Number of subbuffers per stream. */
+       size_t num_subbuf;
        union {
                /* Original object data that MUST be copied over. */
                struct lttng_ust_object_data *ust;
@@ -71,7 +77,7 @@ struct buffer_reg_uid {
         * Keys to match this object in a hash table. The following three variables
         * identify a unique per UID buffer registry.
         */
-       int session_id;         /* Unique tracing session id. */
+       uint64_t session_id;    /* Unique tracing session id. */
        int bits_per_long;      /* ABI */
        uid_t uid;                      /* Owner. */
 
@@ -82,26 +88,33 @@ struct buffer_reg_uid {
        struct lttng_ht_node_u64 node;
        /* Node of a linked list used to teardown object at a destroy session. */
        struct cds_list_head lnode;
+
+       char root_shm_path[PATH_MAX];
+       char shm_path[PATH_MAX];
 };
 
 /*
  * Registry object for per PID buffers.
  */
 struct buffer_reg_pid {
-       int session_id;
+       uint64_t session_id;
 
        struct buffer_reg_session *registry;
 
        /* Indexed by session id. */
-       struct lttng_ht_node_ulong node;
+       struct lttng_ht_node_u64 node;
+
+       char root_shm_path[PATH_MAX];
+       char shm_path[PATH_MAX];
 };
 
 /* Buffer registry per UID. */
 void buffer_reg_init_uid_registry(void);
-int buffer_reg_uid_create(int session_id, uint32_t bits_per_long, uid_t uid,
-               enum lttng_domain_type domain, struct buffer_reg_uid **regp);
+int buffer_reg_uid_create(uint64_t session_id, uint32_t bits_per_long, uid_t uid,
+               enum lttng_domain_type domain, struct buffer_reg_uid **regp,
+               const char *root_shm_path, const char *shm_path);
 void buffer_reg_uid_add(struct buffer_reg_uid *reg);
-struct buffer_reg_uid *buffer_reg_uid_find(int session_id,
+struct buffer_reg_uid *buffer_reg_uid_find(uint64_t session_id,
                uint32_t bits_per_long, uid_t uid);
 void buffer_reg_uid_remove(struct buffer_reg_uid *regp);
 void buffer_reg_uid_destroy(struct buffer_reg_uid *regp,
@@ -109,9 +122,10 @@ void buffer_reg_uid_destroy(struct buffer_reg_uid *regp,
 
 /* Buffer registry per PID. */
 void buffer_reg_init_pid_registry(void);
-int buffer_reg_pid_create(int session_id, struct buffer_reg_pid **regp);
+int buffer_reg_pid_create(uint64_t session_id, struct buffer_reg_pid **regp,
+               const char *root_shm_path, const char *shm_path);
 void buffer_reg_pid_add(struct buffer_reg_pid *reg);
-struct buffer_reg_pid *buffer_reg_pid_find(int session_id);
+struct buffer_reg_pid *buffer_reg_pid_find(uint64_t session_id);
 void buffer_reg_pid_remove(struct buffer_reg_pid *regp);
 void buffer_reg_pid_destroy(struct buffer_reg_pid *regp);
 
@@ -133,11 +147,11 @@ void buffer_reg_stream_add(struct buffer_reg_stream *stream,
 void buffer_reg_stream_destroy(struct buffer_reg_stream *regp,
                enum lttng_domain_type domain);
 
-/* Session */
-void buffer_reg_session_destroy(struct buffer_reg_session *regp,
-               enum lttng_domain_type domain);
-
 /* Global registry. */
 void buffer_reg_destroy_registries(void);
 
+int buffer_reg_uid_consumer_channel_key(
+               struct cds_list_head *buffer_reg_uid_list,
+               uint64_t chan_key, uint64_t *consumer_chan_key);
+
 #endif /* LTTNG_BUFFER_REGISTRY_H */
This page took 0.024145 seconds and 4 git commands to generate.