2 * Copyright (C) 2019 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
19 #define LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
21 #include <lttng/session-descriptor.h>
22 #include <lttng/lttng-error.h>
23 #include <common/uri.h>
24 #include <common/dynamic-buffer.h>
25 #include <common/buffer-view.h>
28 /* Note that these enums are used as part of the lttnctl protocol. */
29 enum lttng_session_descriptor_type
{
30 LTTNG_SESSION_DESCRIPTOR_TYPE_UNKNOWN
= -1,
32 * The output type determines whether this is a no-output, local,
33 * or networked tracing session.
35 LTTNG_SESSION_DESCRIPTOR_TYPE_REGULAR
= 1,
36 LTTNG_SESSION_DESCRIPTOR_TYPE_SNAPSHOT
= 2,
37 LTTNG_SESSION_DESCRIPTOR_TYPE_LIVE
= 3,
40 enum lttng_session_descriptor_output_type
{
41 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NONE
= 0,
42 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_LOCAL
= 1,
43 LTTNG_SESSION_DESCRIPTOR_OUTPUT_TYPE_NETWORK
= 2,
47 ssize_t
lttng_session_descriptor_create_from_buffer(
48 const struct lttng_buffer_view
*view
,
49 struct lttng_session_descriptor
**descriptor
);
52 int lttng_session_descriptor_serialize(
53 const struct lttng_session_descriptor
*descriptor
,
54 struct lttng_dynamic_buffer
*buffer
);
57 enum lttng_session_descriptor_type
58 lttng_session_descriptor_get_type(
59 const struct lttng_session_descriptor
*descriptor
);
62 enum lttng_session_descriptor_output_type
63 lttng_session_descriptor_get_output_type(
64 const struct lttng_session_descriptor
*descriptor
);
67 void lttng_session_descriptor_get_local_output_uri(
68 const struct lttng_session_descriptor
*descriptor
,
69 struct lttng_uri
*local_uri
);
72 void lttng_session_descriptor_get_network_output_uris(
73 const struct lttng_session_descriptor
*descriptor
,
74 struct lttng_uri
*control
,
75 struct lttng_uri
*data
);
79 lttng_session_descriptor_live_get_timer_interval(
80 const struct lttng_session_descriptor
*descriptor
);
83 enum lttng_session_descriptor_status
84 lttng_session_descriptor_get_session_name(
85 const struct lttng_session_descriptor
*descriptor
,
89 int lttng_session_descriptor_set_session_name(
90 struct lttng_session_descriptor
*descriptor
,
94 bool lttng_session_descriptor_is_output_destination_initialized(
95 const struct lttng_session_descriptor
*descriptor
);
98 bool lttng_session_descriptor_has_output_directory(
99 const struct lttng_session_descriptor
*descriptor
);
102 enum lttng_error_code
lttng_session_descriptor_set_default_output(
103 struct lttng_session_descriptor
*descriptor
,
104 time_t *session_creation_time
,
105 const char *absolute_home_path
);
108 int lttng_session_descriptor_assign(
109 struct lttng_session_descriptor
*dst_descriptor
,
110 const struct lttng_session_descriptor
*src_descriptor
);
112 #endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */