vscode: Add configurations to run the executables under the debugger
[lttng-tools.git] / src / bin / lttng-sessiond / ust-field-convert.hpp
CommitLineData
d7bfb9b0
JG
1/*
2 * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef LTTNG_UST_FIELD_CONVERT_H
9#define LTTNG_UST_FIELD_CONVERT_H
10
11#include "field.hpp"
b0f2e8db 12#include "ust-registry-session.hpp"
28f23191 13#include "ust-registry.hpp"
d7bfb9b0
JG
14
15#include <cstddef>
63c3462c 16#include <type_traits>
28f23191 17#include <vector>
d7bfb9b0
JG
18
19namespace lttng {
20namespace sessiond {
21namespace ust {
22
63c3462c
JG
23enum class ctl_field_quirks : unsigned int {
24 NONE = 0,
25 /*
26 * LTTng-UST with ABI major version <= 9 express variants with a tag
27 * enumeration that doesn't match the fields of the variant. The
28 * tag's mapping names are systematically prefixed with an underscore.
29 */
30 UNDERSCORE_PREFIXED_VARIANT_TAG_MAPPINGS = 1 << 0,
31};
32
33inline ctl_field_quirks operator&(ctl_field_quirks lhs, ctl_field_quirks rhs)
34{
35 using enum_type = std::underlying_type<ctl_field_quirks>::type;
36 return ctl_field_quirks(static_cast<enum_type>(lhs) & static_cast<enum_type>(rhs));
37}
38
39inline ctl_field_quirks operator|(ctl_field_quirks lhs, ctl_field_quirks rhs)
40{
41 using enum_type = std::underlying_type<ctl_field_quirks>::type;
42 return ctl_field_quirks(static_cast<enum_type>(lhs) | static_cast<enum_type>(rhs));
43}
44
28f23191
JG
45std::vector<trace::field::cuptr>
46create_trace_fields_from_ust_ctl_fields(const lttng::sessiond::ust::registry_session& session,
47 const lttng_ust_ctl_field *fields,
48 std::size_t field_count,
49 trace::field_location::root lookup_root,
50 ctl_field_quirks quirks = ctl_field_quirks::NONE);
d7bfb9b0
JG
51
52} /* namespace ust */
53} /* namespace sessiond */
54} /* namespace lttng */
55
56#endif /* LTTNG_UST_FIELD_CONVERT_H */
This page took 0.170383 seconds and 4 git commands to generate.