+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;
+}
+