X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Fsessiond-comm.h;h=d1a2bd97de18574b82344a6cc52fa169c4ec3a14;hp=fd1ceae117c279210071326ab3544ebe58ad2253;hb=fbc9f37df245d544a7705ba576297df791220b44;hpb=159b042f34366d0fde5dcd73b4231c558922a664 diff --git a/src/common/sessiond-comm/sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h index fd1ceae11..d1a2bd97d 100644 --- a/src/common/sessiond-comm/sessiond-comm.h +++ b/src/common/sessiond-comm/sessiond-comm.h @@ -41,7 +41,12 @@ #define LTTNG_SESSIOND_COMM_MAX_LISTEN 64 /* Maximum number of FDs that can be sent over a Unix socket */ -#define LTTCOMM_MAX_SEND_FDS 4 +#if defined(__linux__) +/* Based on the kernel's SCM_MAX_FD which is 253 since 2.6.38 (255 before) */ +#define LTTCOMM_MAX_SEND_FDS 253 +#else +#define LTTCOMM_MAX_SEND_FDS 16 +#endif /* * Get the error code index from 0 since LTTCOMM_OK start at 1000 @@ -101,6 +106,7 @@ enum lttcomm_sessiond_command { LTTNG_SESSION_LIST_ROTATION_SCHEDULES = 48, LTTNG_CREATE_SESSION_EXT = 49, LTTNG_CLEAR_SESSION = 50, + LTTNG_LIST_TRIGGERS = 51, }; enum lttcomm_relayd_command { @@ -179,6 +185,7 @@ enum lttcomm_return_code { LTTCOMM_CONSUMERD_TRACE_CHUNK_EXISTS_REMOTE,/* Trace chunk exists on relay daemon. */ LTTCOMM_CONSUMERD_UNKNOWN_TRACE_CHUNK, /* Unknown trace chunk. */ LTTCOMM_CONSUMERD_RELAYD_CLEAR_DISALLOWED, /* Relayd does not accept clear command. */ + LTTCOMM_CONSUMERD_UNKNOWN_ERROR, /* Unknown error. */ /* MUST be last element */ LTTCOMM_NR, /* Last element */ @@ -277,7 +284,7 @@ struct lttcomm_session_msg { /* Event data */ struct { char channel_name[LTTNG_SYMBOL_NAME_LEN]; - struct lttng_event event LTTNG_PACKED; + struct lttng_event event; /* Length of following filter expression. */ uint32_t expression_len; /* Length of following bytecode for filter. */ @@ -296,7 +303,7 @@ struct lttcomm_session_msg { } LTTNG_PACKED enable; struct { char channel_name[LTTNG_SYMBOL_NAME_LEN]; - struct lttng_event event LTTNG_PACKED; + struct lttng_event event; /* Length of following filter expression. */ uint32_t expression_len; /* Length of following bytecode for filter. */ @@ -310,14 +317,13 @@ struct lttcomm_session_msg { } LTTNG_PACKED disable; /* Create channel */ struct { - struct lttng_channel chan LTTNG_PACKED; - /* struct lttng_channel_extended is already packed. */ + struct lttng_channel chan; struct lttng_channel_extended extended; } LTTNG_PACKED channel; /* Context */ struct { char channel_name[LTTNG_SYMBOL_NAME_LEN]; - struct lttng_event_context ctx LTTNG_PACKED; + struct lttng_event_context ctx; uint32_t provider_name_len; uint32_t context_name_len; } LTTNG_PACKED context; @@ -336,18 +342,18 @@ struct lttcomm_session_msg { uint32_t size; } LTTNG_PACKED uri; struct { - struct lttng_snapshot_output output LTTNG_PACKED; + struct lttng_snapshot_output output; } LTTNG_PACKED snapshot_output; struct { uint32_t wait; - struct lttng_snapshot_output output LTTNG_PACKED; + struct lttng_snapshot_output output; } LTTNG_PACKED snapshot_record; struct { uint32_t nb_uri; unsigned int timer_interval; /* usec */ } LTTNG_PACKED session_live; struct { - struct lttng_save_session_attr attr; /* struct already packed */ + struct lttng_save_session_attr attr; } LTTNG_PACKED save_session; struct { char shm_path[PATH_MAX]; @@ -410,6 +416,8 @@ struct lttcomm_session_msg { /* An lttng_session_descriptor follows. */ } LTTNG_PACKED create_session; } u; + /* Count of fds sent. */ + uint32_t fd_count; } LTTNG_PACKED; #define LTTNG_FILTER_MAX_LEN 65536 @@ -501,6 +509,7 @@ struct lttcomm_lttng_msg { uint32_t pid; /* pid_t */ uint32_t cmd_header_size; uint32_t data_size; + uint32_t fd_count; } LTTNG_PACKED; struct lttcomm_lttng_output_id { @@ -534,6 +543,8 @@ struct lttcomm_consumer_msg { uint32_t monitor; /* timer to check the streams usage in live mode (usec). */ unsigned int live_timer_interval; + /* is part of a live session */ + uint8_t is_live; /* timer to sample a channel's positions (usec). */ unsigned int monitor_timer_interval; } LTTNG_PACKED channel; /* Only used by Kernel. */ @@ -567,6 +578,7 @@ struct lttcomm_consumer_msg { uint32_t switch_timer_interval; /* usec */ uint32_t read_timer_interval; /* usec */ unsigned int live_timer_interval; /* usec */ + uint8_t is_live; /* is part of a live session */ uint32_t monitor_timer_interval; /* usec */ int32_t output; /* splice, mmap */ int32_t type; /* metadata or per_cpu */ @@ -702,6 +714,9 @@ struct lttcomm_consumer_msg { struct { uint64_t key; } LTTNG_PACKED clear_channel; + struct { + uint64_t key; + } LTTNG_PACKED open_channel_packets; } u; } LTTNG_PACKED;