2 * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_CTL_HELPER_H
9 #define LTTNG_CTL_HELPER_H
13 #include <common/sessiond-comm/sessiond-comm.h>
14 #include <lttng/lttng.h>
17 * NOTE: Every symbol in this helper header MUST be set to hidden so not to
18 * polute the library name space. Use LTTNG_HIDDEN macro before declaring the
19 * function in the C file.
22 /* Copy helper functions. */
23 void lttng_ctl_copy_lttng_domain(struct lttng_domain
*dst
,
24 struct lttng_domain
*src
);
27 * Sends the lttcomm message to the session daemon and fills buf if the
28 * returned data is not NULL.
30 * Return the size of the received data on success or else a negative lttng
31 * error code. If buf is NULL, 0 is returned on success.
33 int lttng_ctl_ask_sessiond_fds_varlen(struct lttcomm_session_msg
*lsm
,
34 const int *fds
, size_t nb_fd
,
35 const void *vardata
, size_t vardata_len
,
36 void **user_payload_buf
, void **user_cmd_header_buf
,
37 size_t *user_cmd_header_len
);
40 * Calls lttng_ctl_ask_sessiond_fds_varlen() with no expected command header.
42 static inline int lttng_ctl_ask_sessiond_varlen_no_cmd_header(
43 struct lttcomm_session_msg
*lsm
,
46 void **user_payload_buf
)
48 return lttng_ctl_ask_sessiond_fds_varlen(lsm
, NULL
, 0, vardata
,
49 vardata_len
, user_payload_buf
, NULL
, NULL
);
53 * Calls lttng_ctl_ask_sessiond_fds_varlen() with fds and no expected command header.
56 int lttng_ctl_ask_sessiond_fds_no_cmd_header(struct lttcomm_session_msg
*lsm
,
57 const int *fds
, size_t nb_fd
, void **buf
)
59 return lttng_ctl_ask_sessiond_fds_varlen(lsm
, fds
, nb_fd
, NULL
,
63 * Use this if no variable length data needs to be sent.
66 int lttng_ctl_ask_sessiond(struct lttcomm_session_msg
*lsm
, void **buf
)
68 return lttng_ctl_ask_sessiond_varlen_no_cmd_header(lsm
, NULL
, 0, buf
);
71 int lttng_check_tracing_group(void);
73 int connect_sessiond(void);
75 #endif /* LTTNG_CTL_HELPER_H */
This page took 0.030614 seconds and 4 git commands to generate.