CLI: Add lttng_trace_format_descriptor to lttng_session_extended
[lttng-tools.git] / include / lttng / session-internal.hpp
1 /*
2 * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_SESSION_INTERNAL_H
9 #define LTTNG_SESSION_INTERNAL_H
10
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>
17
18 struct lttng_session;
19 struct lttng_payload_view;
20
21 struct lttng_session_extended {
22 LTTNG_OPTIONAL(uint64_t) creation_time;
23 /*
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.
26 */
27 struct lttng_buffer_view serialized_trace_format_descriptor;
28 };
29
30 struct lttng_session_comm {
31 uint32_t name_len;
32 uint32_t path_len;
33 uint8_t enabled;
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;
39 /*
40 * Dynamic payload:
41 * - name[name_len]
42 * - path[path_len]
43 * - trace_format_descriptor
44 */
45 char payload[];
46 } LTTNG_PACKED;
47
48 int lttng_session_serialize(const struct lttng_session *session, struct lttng_payload *payload);
49
50 ssize_t lttng_session_create_from_payload(
51 struct lttng_payload_view *view, struct lttng_session **out_session);
52
53 enum lttng_error_code lttng_sessions_create_and_flatten_from_payload(
54 struct lttng_payload_view *view,
55 unsigned int count,
56 struct lttng_session **sessions);
57
58 #endif /* LTTNG_SESSION_INTERNAL_H */
This page took 0.036891 seconds and 5 git commands to generate.