-struct ust_registry_session {
- /*
- * With multiple writers and readers, use this lock to access
- * the registry. Can nest within the ust app session lock.
- * Also acts as a registry serialization lock. Used by registry
- * readers to serialize the registry information sent from the
- * sessiond to the consumerd.
- * The consumer socket lock nests within this lock.
- */
- pthread_mutex_t lock;
- /* Next channel ID available for a newly registered channel. */
- uint32_t next_channel_id;
- /* Once this value reaches UINT32_MAX, no more id can be allocated. */
- uint32_t used_channel_id;
- /* Next enumeration ID available. */
- uint64_t next_enum_id;
- /* Universal unique identifier used by the tracer. */
- unsigned char uuid[LTTNG_UUID_LEN];
-
- /* session ABI description */
-
- /* Size of long, in bits */
- unsigned int bits_per_long;
- /* Alignment, in bits */
- unsigned int uint8_t_alignment,
- uint16_t_alignment,
- uint32_t_alignment,
- uint64_t_alignment,
- long_alignment;
- /* endianness */
- int byte_order; /* BIG_ENDIAN or LITTLE_ENDIAN */
-
- /* Generated metadata. */
- char *metadata; /* NOT null-terminated ! Use memcpy. */
- size_t metadata_len, metadata_alloc_len;
- /* Length of bytes sent to the consumer. */
- size_t metadata_len_sent;
- /* Current version of the metadata. */
- uint64_t metadata_version;
-
- /*
- * Those fields are only used when a session is created with
- * the --shm-path option. In this case, the metadata is output
- * twice: once to the consumer, as ususal, but a second time
- * also in the shm path directly. This is done so that a copy
- * of the metadata that is as fresh as possible is available
- * on the event of a crash.
- *
- * root_shm_path contains the shm-path provided by the user, along with
- * the session's name and timestamp:
- * e.g. /tmp/my_shm/my_session-20180612-135822
- *
- * shm_path contains the full path of the memory buffers:
- * e.g. /tmp/my_shm/my_session-20180612-135822/ust/uid/1000/64-bit
- *
- * metadata_path contains the full path to the metadata file that
- * is kept for the "crash buffer" extraction:
- * e.g. /tmp/my_shm/my_session-20180612-135822/ust/uid/1000/64-bit/metadata
- *
- * Note that this is not the trace's final metadata file. It is
- * only meant to be used to read the contents of the ring buffers
- * in the event of a crash.
- *
- * metadata_fd is a file descriptor that points to the file at
- * 'metadata_path'.
- */
- char root_shm_path[PATH_MAX];
- char shm_path[PATH_MAX];
- char metadata_path[PATH_MAX];
- int metadata_fd; /* file-backed metadata FD */
-
- /*
- * Hash table containing channels sent by the UST tracer. MUST
- * be accessed with a RCU read side lock acquired.
- */
- struct lttng_ht *channels;
- /*
- * Unique key to identify the metadata on the consumer side.
- */
- uint64_t metadata_key;
- /*
- * Indicates if the metadata is closed on the consumer side. This is to
- * avoid double close of metadata when an application unregisters AND
- * deletes its sessions.
- */
- unsigned int metadata_closed;
-
- /* User and group owning the session. */
- uid_t uid;
- gid_t gid;
-
- /* Enumerations table. */
- struct lttng_ht *enums;
-
- /*
- * Copy of the tracer version when the first app is registered.
- * It is used if we need to regenerate the metadata.
- */
- uint32_t major;
- uint32_t minor;
-
- /* The id of the parent session */
- uint64_t tracing_id;
- uid_t tracing_uid;
-};