return status;
}
+static bool is_trace_format_configuration_supported(
+ uint64_t supported_trace_format, lttng::trace_format_descriptor& trace_format)
+{
+ static const std::unordered_map<enum lttng_trace_format_descriptor_type,
+ enum lttcomm_relayd_configuration_trace_format_flag>
+ mapping = {
+ {LTTNG_TRACE_FORMAT_DESCRIPTOR_TYPE_CTF_1,
+ LTTCOMM_RELAYD_CONFIGURATION_TRACE_FORMAT_SUPPORTED_CTF1},
+ };
+
+ auto it = mapping.find(trace_format.type());
+ if (it == mapping.end()) {
+ return false;
+ }
+
+ if (!(supported_trace_format & it->second)) {
+ return false;
+ }
+
+ return true;
+}
+
/*
* Send both relayd sockets to a specific consumer and domain. This is a
* helper function to facilitate sending the information to the consumer for a
if (!sock->control_sock_sent) {
int ret;
uint64_t result_flags = 0;
+ uint64_t supported_trace_format = 0;
/* Connect to relayd and make version check if uri is the control. */
status = create_connect_relayd(&consumer->dst.net.control, &control_sock);
if (status != LTTNG_OK) {
consumer->relay_major_version = control_sock->major;
consumer->relay_minor_version = control_sock->minor;
- ret = relayd_get_configuration(control_sock, 0, &result_flags);
+ ret = relayd_get_configuration(control_sock, 0, result_flags, nullptr);
if (ret < 0) {
ERR("Unable to get relayd configuration");
status = LTTNG_ERR_RELAYD_CONNECT_FAIL;
consumer->relay_allows_clear = true;
}
+ if (!is_trace_format_configuration_supported(
+ supported_trace_format, *session.trace_format)) {
+ ERR("Relayd does not support the requested trace format");
+ status = LTTNG_ERR_TRACE_FORMAT_UNSUPPORTED_RELAY_DAEMON;
+ goto error;
+ }
+
status = send_consumer_relayd_socket(session.id, &consumer->dst.net.control,
consumer, sock, session.name, session.hostname, base_path,
session.live_timer, current_chunk_id, session.creation_time,
usess = session->ust_session;
ksess = session->kernel_session;
- ERR("Setting relayd for session %s", session->name);
+ DBG("Setting relayd for session %s", session->name);
rcu_read_lock();
if (session->current_trace_chunk) {