Copyright ownership transfer
[deliverable/lttng-tools.git] / include / lttng / session-descriptor-internal.h
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_DESCRIPTOR_INTERNAL_H
9 #define LTTNG_SESSION_DESCRIPTOR_INTERNAL_H
10
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>
16 #include <stdbool.h>
17
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,
21 /*
22 * The output type determines whether this is a no-output, local,
23 * or networked tracing session.
24 */
25 LTTNG_SESSION_DESCRIPTOR_TYPE_REGULAR = 1,
26 LTTNG_SESSION_DESCRIPTOR_TYPE_SNAPSHOT = 2,
27 LTTNG_SESSION_DESCRIPTOR_TYPE_LIVE = 3,
28 };
29
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,
34 };
35
36 LTTNG_HIDDEN
37 ssize_t lttng_session_descriptor_create_from_buffer(
38 const struct lttng_buffer_view *view,
39 struct lttng_session_descriptor **descriptor);
40
41 LTTNG_HIDDEN
42 int lttng_session_descriptor_serialize(
43 const struct lttng_session_descriptor *descriptor,
44 struct lttng_dynamic_buffer *buffer);
45
46 LTTNG_HIDDEN
47 enum lttng_session_descriptor_type
48 lttng_session_descriptor_get_type(
49 const struct lttng_session_descriptor *descriptor);
50
51 LTTNG_HIDDEN
52 enum lttng_session_descriptor_output_type
53 lttng_session_descriptor_get_output_type(
54 const struct lttng_session_descriptor *descriptor);
55
56 LTTNG_HIDDEN
57 void lttng_session_descriptor_get_local_output_uri(
58 const struct lttng_session_descriptor *descriptor,
59 struct lttng_uri *local_uri);
60
61 LTTNG_HIDDEN
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);
66
67 LTTNG_HIDDEN
68 unsigned long long
69 lttng_session_descriptor_live_get_timer_interval(
70 const struct lttng_session_descriptor *descriptor);
71
72 LTTNG_HIDDEN
73 int lttng_session_descriptor_set_session_name(
74 struct lttng_session_descriptor *descriptor,
75 const char *name);
76
77 LTTNG_HIDDEN
78 bool lttng_session_descriptor_is_output_destination_initialized(
79 const struct lttng_session_descriptor *descriptor);
80
81 LTTNG_HIDDEN
82 bool lttng_session_descriptor_has_output_directory(
83 const struct lttng_session_descriptor *descriptor);
84
85 LTTNG_HIDDEN
86 enum lttng_error_code lttng_session_descriptor_set_default_output(
87 struct lttng_session_descriptor *descriptor,
88 time_t *session_creation_time,
89 const char *absolute_home_path);
90
91 LTTNG_HIDDEN
92 int lttng_session_descriptor_assign(
93 struct lttng_session_descriptor *dst_descriptor,
94 const struct lttng_session_descriptor *src_descriptor);
95
96 #endif /* LTTNG_SESSION_DESCRIPTOR_INTERNAL_H */
This page took 0.034579 seconds and 5 git commands to generate.