2 * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
9 #define LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
11 #include <lttng/session-descriptor.h>
12 #include <lttng/lttng-error.h>
13 #include <common/uri.h>
14 #include <common/dynamic-buffer.h>
15 #include <common/buffer-view.h>
18 /* Note that these enums are used as part of the lttnctl protocol. */
19 enum lttng_session_descriptor_type
{
20 LTTNG_SESSION_DESCRIPTOR_TYPE_UNKNOWN
= -1,
22 * The output type determines whether this is a no-output, local,
23 * or networked tracing session.
25 LTTNG_SESSION_DESCRIPTOR_TYPE_REGULAR
= 1,
26 LTTNG_SESSION_DESCRIPTOR_TYPE_SNAPSHOT
= 2,
27 LTTNG_SESSION_DESCRIPTOR_TYPE_LIVE
= 3,
30 enum lttng_session_descriptor_output_type
{
31 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NONE
= 0,
32 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_LOCAL
= 1,
33 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK
= 2,
37 ssize_t
lttng_session_descriptor_create_from_buffer(
38 const struct lttng_buffer_view
*view
,
39 struct lttng_session_descriptor
**descriptor
);
42 int lttng_session_descriptor_serialize(
43 const struct lttng_session_descriptor
*descriptor
,
44 struct lttng_dynamic_buffer
*buffer
);
47 enum lttng_session_descriptor_type
48 lttng_session_descriptor_get_type(
49 const struct lttng_session_descriptor
*descriptor
);
52 enum lttng_session_descriptor_output_type
53 lttng_session_descriptor_get_output_type(
54 const struct lttng_session_descriptor
*descriptor
);
57 void lttng_session_descriptor_get_local_output_uri(
58 const struct lttng_session_descriptor
*descriptor
,
59 struct lttng_uri
*local_uri
);
62 void lttng_session_descriptor_get_network_output_uris(
63 const struct lttng_session_descriptor
*descriptor
,
64 struct lttng_uri
*control
,
65 struct lttng_uri
*data
);
69 lttng_session_descriptor_live_get_timer_interval(
70 const struct lttng_session_descriptor
*descriptor
);
73 enum lttng_session_descriptor_status
74 lttng_session_descriptor_get_session_name(
75 const struct lttng_session_descriptor
*descriptor
,
79 int lttng_session_descriptor_set_session_name(
80 struct lttng_session_descriptor
*descriptor
,
84 bool lttng_session_descriptor_is_output_destination_initialized(
85 const struct lttng_session_descriptor
*descriptor
);
88 bool lttng_session_descriptor_has_output_directory(
89 const struct lttng_session_descriptor
*descriptor
);
92 enum lttng_error_code
lttng_session_descriptor_set_default_output(
93 struct lttng_session_descriptor
*descriptor
,
94 time_t *session_creation_time
,
95 const char *absolute_home_path
);
98 int lttng_session_descriptor_assign(
99 struct lttng_session_descriptor
*dst_descriptor
,
100 const struct lttng_session_descriptor
*src_descriptor
);
102 #endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */