} while (0)
#endif
+#define COPY_DOMAIN_PACKED(dst, src) \
+do { \
+ struct lttng_domain _tmp_domain; \
+ \
+ lttng_ctl_copy_lttng_domain(&_tmp_domain, &src); \
+ dst = _tmp_domain; \
+} while (0)
/* Socket to session daemon for communication */
static int sessiond_socket = -1;
lsm.cmd_type = LTTNG_REGISTER_CONSUMER;
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
lttng_ctl_copy_string(lsm.u.reg.path, socket_path,
sizeof(lsm.u.reg.path));
sizeof(lsm.u.context.channel_name));
}
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
lttng_ctl_copy_string(ev->name, "*", sizeof(ev->name));
}
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
- /* FIXME: copying non-packed struct to packed struct. */
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
memcpy(&lsm.u.enable.event, ev, sizeof(lsm.u.enable.event));
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
lsm.cmd_type = LTTNG_DISABLE_EVENT;
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
- /* FIXME: copying non-packed struct to packed struct. */
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
memcpy(&lsm.u.disable.event, ev, sizeof(lsm.u.disable.event));
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
}
lsm.cmd_type = LTTNG_ENABLE_CHANNEL;
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
lttng_ctl_copy_string(lsm.u.disable.channel_name, name,
sizeof(lsm.u.disable.channel_name));
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
lsm.cmd_type = LTTNG_TRACK_PID;
lsm.u.pid_tracker.pid = pid;
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
lsm.cmd_type = LTTNG_UNTRACK_PID;
lsm.u.pid_tracker.pid = pid;
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
memset(&lsm, 0, sizeof(lsm));
lsm.cmd_type = LTTNG_LIST_TRACEPOINTS;
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
ret = lttng_ctl_ask_sessiond(&lsm, (void **) events);
if (ret < 0) {
memset(&lsm, 0, sizeof(lsm));
lsm.cmd_type = LTTNG_LIST_TRACEPOINT_FIELDS;
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
ret = lttng_ctl_ask_sessiond(&lsm, (void **) fields);
if (ret < 0) {
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
ret = lttng_ctl_ask_sessiond(&lsm, (void**) channels);
if (ret < 0) {
sizeof(lsm.session.name));
lttng_ctl_copy_string(lsm.u.list.channel_name, channel_name,
sizeof(lsm.u.list.channel_name));
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
ret = lttng_ctl_ask_sessiond_fds_varlen(&lsm, NULL, 0, NULL, 0,
(void **) &reception_buffer, (void **) &cmd_header,
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
size = uri_parse_str_urls(control_url, data_url, &uris);
if (size < 0) {
lsm.cmd_type = LTTNG_LIST_TRACKER_PIDS;
lttng_ctl_copy_string(lsm.session.name, handle->session_name,
sizeof(lsm.session.name));
- lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain);
+ COPY_DOMAIN_PACKED(lsm.domain, handle->domain);
ret = lttng_ctl_ask_sessiond(&lsm, (void **) &pids);
if (ret < 0) {