2 * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_SESSION_INTERNAL_H
9 #define LTTNG_SESSION_INTERNAL_H
11 #include <common/buffer-view.hpp>
12 #include <common/macros.hpp>
13 #include <common/optional.hpp>
14 #include <lttng/constant.h>
15 #include <lttng/lttng-error.h>
16 #include <lttng/trace-format-descriptor-internal.hpp>
19 struct lttng_payload_view;
21 struct lttng_session_extended {
22 LTTNG_OPTIONAL(uint64_t) creation_time;
24 * This is done this way to satisfy the API memory restriction for lttng_session on listing.
25 * The caller must be able to simply call free on the return object and all memory be freed.
27 struct lttng_buffer_view serialized_trace_format_descriptor;
30 struct lttng_session_comm {
34 uint32_t snapshot_mode;
35 uint32_t live_timer_interval;
36 uint32_t trace_format_descriptor_len;
37 /* lttng_session_extended data */
38 LTTNG_OPTIONAL(uint64_t) LTTNG_PACKED creation_time;
43 * - trace_format_descriptor
48 int lttng_session_serialize(const struct lttng_session *session, struct lttng_payload *payload);
50 ssize_t lttng_session_create_from_payload(
51 struct lttng_payload_view *view, struct lttng_session **out_session);
53 enum lttng_error_code lttng_sessions_create_and_flatten_from_payload(
54 struct lttng_payload_view *view,
56 struct lttng_session **sessions);
58 #endif /* LTTNG_SESSION_INTERNAL_H */