return err;
}
-
-int lttctl_align(const struct lttctl_handle *h,
- char *name, unsigned alignment)
-{
- struct {
- struct nlmsghdr nlh;
- lttctl_peer_msg_t msg;
- } req;
- struct {
- struct nlmsghdr nlh;
- struct nlmsgerr nlerr;
- lttctl_peer_msg_t msg;
- } ack;
- int err;
-
- memset(&req, 0, sizeof(req));
- req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(lttctl_peer_msg_t));
- req.nlh.nlmsg_flags = NLM_F_REQUEST;
- req.nlh.nlmsg_type = LTTCTLM_CONTROL;
- req.nlh.nlmsg_pid = h->local.nl_pid;
-
- strncpy(req.msg.trace_name, name, NAME_MAX);
- req.msg.op = OP_ALIGN;
- req.msg.args.alignment = alignment;
-
- err = lttctl_netlink_sendto(h, (void *)&req, req.nlh.nlmsg_len);
- if(err < 0) goto senderr;
-
- err = lttctl_netlink_recvfrom(h, (void*)&ack, sizeof(ack), 0);
- if(err < 0) goto senderr;
-
- err = ack.nlerr.error;
- if(err != 0) {
- errno = err;
- lttctl_perror("Align Trace Error");
- return -1;
- }
-
- return 0;
-
-senderr:
- lttctl_perror("Align Trace Error");
- return err;
-}