summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e736018)
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.
This causes problems in a follow-up patch since packet header, context,
and event headers become dynamically generated.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I0aeb24ab2e1c0ee1ea70d2fb9bb0eabbb2e9e035
#include <common/uuid.hpp>
#include <array>
#include <common/uuid.hpp>
#include <array>
+#include <queue>
+#include <set>
namespace lst = lttng::sessiond::trace;
namespace tsdl = lttng::sessiond::tsdl;
namespace lst = lttng::sessiond::trace;
namespace tsdl = lttng::sessiond::tsdl;
const auto ctf_spec_major = 1;
const auto ctf_spec_minor = 8;
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
/*
* 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");
}
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());
std::string new_identifier;
/* Optimisticly assume most identifiers are valid and allocate the same length. */
new_identifier.reserve(original_identifier.size());