CLI: Add lttng_trace_format_descriptor to lttng_session_extended
[lttng-tools.git] / include / lttng / session-internal.hpp
CommitLineData
b178f53e 1/*
ab5be9fa 2 * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
b178f53e 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
b178f53e 5 *
b178f53e
JG
6 */
7
8#ifndef LTTNG_SESSION_INTERNAL_H
9#define LTTNG_SESSION_INTERNAL_H
10
2d321d3e 11#include <common/buffer-view.hpp>
c9e313bc 12#include <common/macros.hpp>
2d321d3e
JR
13#include <common/optional.hpp>
14#include <lttng/constant.h>
15#include <lttng/lttng-error.h>
989ddaeb 16#include <lttng/trace-format-descriptor-internal.hpp>
2d321d3e
JR
17
18struct lttng_session;
19struct lttng_payload_view;
b178f53e
JG
20
21struct lttng_session_extended {
2d321d3e 22 LTTNG_OPTIONAL(uint64_t) creation_time;
989ddaeb
JR
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;
2d321d3e
JR
28};
29
30struct 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;
989ddaeb 36 uint32_t trace_format_descriptor_len;
2d321d3e
JR
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]
989ddaeb 43 * - trace_format_descriptor
2d321d3e
JR
44 */
45 char payload[];
b178f53e
JG
46} LTTNG_PACKED;
47
2d321d3e
JR
48int lttng_session_serialize(const struct lttng_session *session, struct lttng_payload *payload);
49
50ssize_t lttng_session_create_from_payload(
51 struct lttng_payload_view *view, struct lttng_session **out_session);
52
53enum 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
b178f53e 58#endif /* LTTNG_SESSION_INTERNAL_H */
This page took 0.05057 seconds and 5 git commands to generate.