#include <common/uuid.hpp>
#include <array>
-#include <queue>
#include <locale>
+#include <queue>
+#include <set>
namespace lst = lttng::sessiond::trace;
namespace tsdl = lttng::sessiond::tsdl;
const auto ctf_spec_major = 1;
const auto ctf_spec_minor = 8;
+/*
+ * Although the CTF v1.8 specification recommends ignoring any leading underscore, Some readers,
+ * such as Babeltrace 1.x, expect special identifiers without a prepended underscore.
+ */
+const std::set<std::string> safe_tsdl_identifiers = {"stream_id"};
+
/*
* A previous implementation always prepended '_' to the identifiers in order to
* side-step the problem of escaping TSDL keywords and ensuring identifiers
LTTNG_THROW_ERROR("Invalid 0-length identifier used in trace description");
}
+ if (safe_tsdl_identifiers.find(original_identifier) != safe_tsdl_identifiers.end()) {
+ return original_identifier;
+ }
+
std::string new_identifier;
/* Optimisticly assume most identifiers are valid and allocate the same length. */
new_identifier.reserve(original_identifier.size());