X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Fsessiond-comm.h;h=836c3af66b28877d50c5d5a7fc1ed1745d577438;hp=8c4fe0ee7eed02293031b74ec9666fc375da72b6;hb=fb9a95c4d6242bd8336b638c90a7d8f846125659;hpb=2288467f63826a06d25ac361fa04ea92ec7ddfa3 diff --git a/src/common/sessiond-comm/sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h index 8c4fe0ee7..836c3af66 100644 --- a/src/common/sessiond-comm/sessiond-comm.h +++ b/src/common/sessiond-comm/sessiond-comm.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -58,55 +59,54 @@ enum lttcomm_sessiond_command { /* Tracer command */ - LTTNG_ADD_CONTEXT = 0, + LTTNG_ADD_CONTEXT = 0, /* LTTNG_CALIBRATE used to be here */ - LTTNG_DISABLE_CHANNEL = 2, - LTTNG_DISABLE_EVENT = 3, - LTTNG_LIST_SYSCALLS = 4, - LTTNG_ENABLE_CHANNEL = 5, - LTTNG_ENABLE_EVENT = 6, + LTTNG_DISABLE_CHANNEL = 2, + LTTNG_DISABLE_EVENT = 3, + LTTNG_LIST_SYSCALLS = 4, + LTTNG_ENABLE_CHANNEL = 5, + LTTNG_ENABLE_EVENT = 6, /* 7 */ /* Session daemon command */ - LTTNG_CREATE_SESSION = 8, - LTTNG_DESTROY_SESSION = 9, - LTTNG_LIST_CHANNELS = 10, - LTTNG_LIST_DOMAINS = 11, - LTTNG_LIST_EVENTS = 12, - LTTNG_LIST_SESSIONS = 13, - LTTNG_LIST_TRACEPOINTS = 14, - LTTNG_REGISTER_CONSUMER = 15, - LTTNG_START_TRACE = 16, - LTTNG_STOP_TRACE = 17, - LTTNG_LIST_TRACEPOINT_FIELDS = 18, + /* 8 */ + LTTNG_DESTROY_SESSION = 9, + LTTNG_LIST_CHANNELS = 10, + LTTNG_LIST_DOMAINS = 11, + LTTNG_LIST_EVENTS = 12, + LTTNG_LIST_SESSIONS = 13, + LTTNG_LIST_TRACEPOINTS = 14, + LTTNG_REGISTER_CONSUMER = 15, + LTTNG_START_TRACE = 16, + LTTNG_STOP_TRACE = 17, + LTTNG_LIST_TRACEPOINT_FIELDS = 18, /* Consumer */ - LTTNG_DISABLE_CONSUMER = 19, - LTTNG_ENABLE_CONSUMER = 20, - LTTNG_SET_CONSUMER_URI = 21, + LTTNG_DISABLE_CONSUMER = 19, + LTTNG_ENABLE_CONSUMER = 20, + LTTNG_SET_CONSUMER_URI = 21, /* 22 */ /* 23 */ - LTTNG_DATA_PENDING = 24, - LTTNG_SNAPSHOT_ADD_OUTPUT = 25, - LTTNG_SNAPSHOT_DEL_OUTPUT = 26, - LTTNG_SNAPSHOT_LIST_OUTPUT = 27, - LTTNG_SNAPSHOT_RECORD = 28, - LTTNG_CREATE_SESSION_SNAPSHOT = 29, - LTTNG_CREATE_SESSION_LIVE = 30, - LTTNG_SAVE_SESSION = 31, - LTTNG_TRACK_PID = 32, - LTTNG_UNTRACK_PID = 33, - LTTNG_LIST_TRACKER_PIDS = 34, - LTTNG_SET_SESSION_SHM_PATH = 40, - LTTNG_REGENERATE_METADATA = 41, - LTTNG_REGENERATE_STATEDUMP = 42, - LTTNG_REGISTER_TRIGGER = 43, - LTTNG_UNREGISTER_TRIGGER = 44, - LTTNG_ROTATE_SESSION = 45, - LTTNG_ROTATION_GET_INFO = 46, - LTTNG_ROTATION_SET_SCHEDULE = 47, - LTTNG_SESSION_GET_CURRENT_OUTPUT = 48, - LTTNG_ROTATION_SCHEDULE_GET_TIMER_PERIOD = 49, - LTTNG_ROTATION_SCHEDULE_GET_SIZE = 50, + LTTNG_DATA_PENDING = 24, + LTTNG_SNAPSHOT_ADD_OUTPUT = 25, + LTTNG_SNAPSHOT_DEL_OUTPUT = 26, + LTTNG_SNAPSHOT_LIST_OUTPUT = 27, + LTTNG_SNAPSHOT_RECORD = 28, + /* 29 */ + /* 30 */ + LTTNG_SAVE_SESSION = 31, + LTTNG_TRACK_PID = 32, + LTTNG_UNTRACK_PID = 33, + LTTNG_LIST_TRACKER_PIDS = 34, + LTTNG_SET_SESSION_SHM_PATH = 40, + LTTNG_REGENERATE_METADATA = 41, + LTTNG_REGENERATE_STATEDUMP = 42, + LTTNG_REGISTER_TRIGGER = 43, + LTTNG_UNREGISTER_TRIGGER = 44, + LTTNG_ROTATE_SESSION = 45, + LTTNG_ROTATION_GET_INFO = 46, + LTTNG_ROTATION_SET_SCHEDULE = 47, + LTTNG_SESSION_LIST_ROTATION_SCHEDULES = 48, + LTTNG_CREATE_SESSION_EXT = 49 }; enum lttcomm_relayd_command { @@ -166,6 +166,12 @@ enum lttcomm_return_code { LTTCOMM_CONSUMERD_CHANNEL_FAIL, /* Channel creation failed. */ LTTCOMM_CONSUMERD_CHAN_NOT_FOUND, /* Channel not found. */ LTTCOMM_CONSUMERD_ALREADY_SET, /* Resource already set. */ + LTTCOMM_CONSUMERD_ROTATION_FAIL, /* Rotation has failed. */ + LTTCOMM_CONSUMERD_ROTATE_RENAME_FAILED, /* Rotation rename has failed. */ + LTTCOMM_CONSUMERD_ROTATION_PENDING_LOCAL_FAILED, /* Rotation pending relay failed. */ + LTTCOMM_CONSUMERD_ROTATION_PENDING_RELAY_FAILED, /* Rotation pending relay failed. */ + LTTCOMM_CONSUMERD_MKDIR_FAILED, /* mkdir has failed. */ + LTTCOMM_CONSUMERD_SNAPSHOT_FAILED, /* snapshot has failed. */ /* MUST be last element */ LTTCOMM_NR, /* Last element */ @@ -262,13 +268,15 @@ struct lttcomm_session_msg { uint32_t expression_len; /* Length of following bytecode for filter. */ uint32_t bytecode_len; - /* exclusion data */ + /* Exclusion count (fixed-size strings). */ uint32_t exclusion_count; + /* Userspace probe location size. */ + uint32_t userspace_probe_location_len; /* * After this structure, the following variable-length * items are transmitted: * - char exclusion_names[LTTNG_SYMBOL_NAME_LEN][exclusion_count] - * - unsigned char filter_expression[expression_len] + * - char filter_expression[expression_len] * - unsigned char filter_bytecode[bytecode_len] */ } LTTNG_PACKED enable; @@ -340,13 +348,31 @@ struct lttcomm_session_msg { uint64_t rotation_id; } LTTNG_PACKED get_rotation_info; struct { - uint64_t timer_us; - uint64_t size; - } LTTNG_PACKED rotate_setup; + /* enum lttng_rotation_schedule_type */ + uint8_t type; + /* + * If set == 1, set schedule to value, if set == 0, + * clear this schedule type. + */ + uint8_t set; + uint64_t value; + } LTTNG_PACKED rotation_set_schedule; + struct { + /* + * Includes the null-terminator. + * Must be an absolute path. + * + * Size bounded by LTTNG_PATH_MAX. + */ + uint16_t home_dir_size; + uint64_t session_descriptor_size; + /* An lttng_session_descriptor follows. */ + } LTTNG_PACKED create_session; } u; } LTTNG_PACKED; #define LTTNG_FILTER_MAX_LEN 65536 +#define LTTNG_SESSION_DESCRIPTOR_MAX_LEN 65536 /* * Filter bytecode data. The reloc table is located at the end of the @@ -403,6 +429,11 @@ struct lttcomm_event_extended_header { * character. */ uint32_t nb_exclusions; + + /* + * Size of the event's userspace probe location (if applicable). + */ + uint32_t userspace_probe_location_len; } LTTNG_PACKED; /* @@ -426,7 +457,7 @@ struct lttcomm_lttng_output_id { * operation. */ struct lttcomm_consumer_msg { - uint32_t cmd_type; /* enum consumerd_command */ + uint32_t cmd_type; /* enum lttng_consumer_command */ union { struct { uint64_t channel_key; @@ -456,6 +487,13 @@ struct lttcomm_consumer_msg { int32_t cpu; /* On which CPU this stream is assigned. */ /* Tells the consumer if the stream should be or not monitored. */ uint32_t no_monitor; + /* + * The archive id that was "current" at the time this + * stream was created. This is used to determine + * whether a rotation request was sent before or after + * the creation of a stream. + */ + uint64_t trace_archive_id; } LTTNG_PACKED stream; /* Only used by Kernel. */ struct { uint64_t net_index; @@ -505,6 +543,13 @@ struct lttcomm_consumer_msg { */ uint32_t ust_app_uid; int64_t blocking_timeout; + /* + * The archive id that was "current" at the time this + * channel was created. This is used to determine + * whether a rotation request was sent before or after + * the creation of a channel. + */ + uint64_t trace_archive_id; char root_shm_path[PATH_MAX]; char shm_path[PATH_MAX]; } LTTNG_PACKED ask_channel; @@ -540,6 +585,12 @@ struct lttcomm_consumer_msg { uint64_t relayd_id; /* Relayd id if apply. */ uint64_t key; uint64_t nb_packets_per_stream; + /* + * The session's current trace archive id is propagated + * since a snapshot triggers the creation of an + * ephemeral metadata stream. + */ + uint64_t trace_archive_id; } LTTNG_PACKED snapshot_channel; struct { uint64_t channel_key; @@ -571,11 +622,15 @@ struct lttcomm_consumer_msg { uint32_t uid; uint32_t gid; } LTTNG_PACKED rotate_rename; + struct { + uint64_t session_id; + uint64_t chunk_id; + } LTTNG_PACKED check_rotation_pending_local; struct { uint64_t relayd_id; uint64_t session_id; uint64_t chunk_id; - } LTTNG_PACKED rotate_pending_relay; + } LTTNG_PACKED check_rotation_pending_relay; struct { char path[LTTNG_PATH_MAX]; uint64_t relayd_id; /* Relayd id if apply. */