projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Store the relay protocol version in the consumer_output
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index c054db917a40c4f86bd217255224a060875f116e..1ee0c98f99dadc3516714409aa20164f44f552ff 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-278,11
+278,21
@@
static void list_lttng_channels(enum lttng_domain_type domain,
channels[i].enabled = uchan->enabled;
channels[i].attr.tracefile_size = uchan->tracefile_size;
channels[i].attr.tracefile_count = uchan->tracefile_count;
channels[i].enabled = uchan->enabled;
channels[i].attr.tracefile_size = uchan->tracefile_size;
channels[i].attr.tracefile_count = uchan->tracefile_count;
+
+ /*
+ * Map enum lttng_ust_output to enum lttng_event_output.
+ */
switch (uchan->attr.output) {
case LTTNG_UST_MMAP:
switch (uchan->attr.output) {
case LTTNG_UST_MMAP:
- default:
channels[i].attr.output = LTTNG_EVENT_MMAP;
break;
channels[i].attr.output = LTTNG_EVENT_MMAP;
break;
+ default:
+ /*
+ * LTTNG_UST_MMAP is the only supported UST
+ * output mode.
+ */
+ assert(0);
+ break;
}
ret = get_ust_runtime_stats(session, uchan,
}
ret = get_ust_runtime_stats(session, uchan,
@@
-580,7
+590,7
@@
static int list_lttng_kernel_events(char *channel_name,
if (nb_event == 0) {
*total_size = 0;
*events = NULL;
if (nb_event == 0) {
*total_size = 0;
*events = NULL;
- goto
syscall
;
+ goto
end
;
}
/* Compute required extended infos size */
}
/* Compute required extended infos size */
@@
-596,7
+606,7
@@
static int list_lttng_kernel_events(char *channel_name,
goto error;
}
goto error;
}
- extended_at = ((
uint8_t *)
events) +
+ extended_at = ((
void *) *
events) +
nb_event * sizeof(struct lttng_event);
/* Kernel channels */
nb_event * sizeof(struct lttng_event);
/* Kernel channels */
@@
-643,19
+653,7
@@
static int list_lttng_kernel_events(char *channel_name,
&extended_at);
}
&extended_at);
}
-syscall:
- if (syscall_table) {
- ssize_t new_size;
-
- new_size = syscall_list_channel(kchan, events, nb_event);
- if (new_size < 0) {
- free(events);
- ret = -new_size;
- goto error;
- }
- nb_event = new_size;
- }
-
+end:
return nb_event;
error:
return nb_event;
error:
@@
-805,7
+803,8
@@
error:
* Else, it's stays untouched and a lttcomm error code is returned.
*/
static int create_connect_relayd(struct lttng_uri *uri,
* Else, it's stays untouched and a lttcomm error code is returned.
*/
static int create_connect_relayd(struct lttng_uri *uri,
- struct lttcomm_relayd_sock **relayd_sock)
+ struct lttcomm_relayd_sock **relayd_sock,
+ struct consumer_output *consumer)
{
int ret;
struct lttcomm_relayd_sock *rsock;
{
int ret;
struct lttcomm_relayd_sock *rsock;
@@
-841,6
+840,8
@@
static int create_connect_relayd(struct lttng_uri *uri,
ret = LTTNG_ERR_RELAYD_VERSION_FAIL;
goto close_sock;
}
ret = LTTNG_ERR_RELAYD_VERSION_FAIL;
goto close_sock;
}
+ consumer->relay_major_version = rsock->major;
+ consumer->relay_minor_version = rsock->minor;
} else if (uri->stype == LTTNG_STREAM_DATA) {
DBG3("Creating relayd data socket from URI");
} else {
} else if (uri->stype == LTTNG_STREAM_DATA) {
DBG3("Creating relayd data socket from URI");
} else {
@@
-876,7
+877,7
@@
static int send_consumer_relayd_socket(enum lttng_domain_type domain,
struct lttcomm_relayd_sock *rsock = NULL;
/* Connect to relayd and make version check if uri is the control. */
struct lttcomm_relayd_sock *rsock = NULL;
/* Connect to relayd and make version check if uri is the control. */
- ret = create_connect_relayd(relayd_uri, &rsock);
+ ret = create_connect_relayd(relayd_uri, &rsock
, consumer
);
if (ret != LTTNG_OK) {
goto error;
}
if (ret != LTTNG_OK) {
goto error;
}
@@
-1011,6
+1012,10
@@
int cmd_setup_relayd(struct ltt_session *session)
/* Session is now ready for network streaming. */
session->net_handle = 1;
}
/* Session is now ready for network streaming. */
session->net_handle = 1;
}
+ session->consumer->relay_major_version =
+ usess->consumer->relay_major_version;
+ session->consumer->relay_minor_version =
+ usess->consumer->relay_minor_version;
}
if (ksess && ksess->consumer && ksess->consumer->type == CONSUMER_DST_NET
}
if (ksess && ksess->consumer && ksess->consumer->type == CONSUMER_DST_NET
@@
-1029,6
+1034,10
@@
int cmd_setup_relayd(struct ltt_session *session)
/* Session is now ready for network streaming. */
session->net_handle = 1;
}
/* Session is now ready for network streaming. */
session->net_handle = 1;
}
+ session->consumer->relay_major_version =
+ ksess->consumer->relay_major_version;
+ session->consumer->relay_minor_version =
+ ksess->consumer->relay_minor_version;
}
error:
}
error:
This page took
0.025447 seconds
and
4
git commands to generate.