*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
LTTCTL_ERR_SUPP,
LTTCTL_ERR_RECVBUF,
LTTCTL_ERR_TIMEOUT,
- LTTCTL_ERR_PROTOCOL
+ LTTCTL_ERR_PROTOCOL
};
#define LTTCTL_MAXERR LTTCTL_ERR_PROTOCOL
static ssize_t lttctl_netlink_sendto(const struct lttctl_handle *h,
- const void *msg, size_t len);
+ const void *msg, size_t len);
static ssize_t lttctl_netlink_recvfrom(const struct lttctl_handle *h,
- unsigned char *buf, size_t len,
- int timeout);
+ unsigned char *buf, size_t len,
+ int timeout);
static ssize_t lttctl_netlink_sendmsg(const struct lttctl_handle *h,
- const struct msghdr *msg,
- unsigned int flags);
+ const struct msghdr *msg,
+ unsigned int flags);
static char *lttctl_strerror(int errcode);
void lttctl_perror(const char *s);
static ssize_t lttctl_netlink_sendto(const struct lttctl_handle *h,
- const void *msg, size_t len)
+ const void *msg, size_t len)
{
int status = sendto(h->fd, msg, len, 0,
- (struct sockaddr *)&h->peer, sizeof(h->peer));
+ (struct sockaddr *)&h->peer, sizeof(h->peer));
if (status < 0)
lttctl_errno = LTTCTL_ERR_SEND;
}
static ssize_t lttctl_netlink_sendmsg(const struct lttctl_handle *h,
- const struct msghdr *msg,
- unsigned int flags)
+ const struct msghdr *msg,
+ unsigned int flags)
{
int status = sendmsg(h->fd, msg, flags);
if (status < 0)
}
static ssize_t lttctl_netlink_recvfrom(const struct lttctl_handle *h,
- unsigned char *buf, size_t len,
- int timeout)
+ unsigned char *buf, size_t len,
+ int timeout)
{
int addrlen, status;
struct nlmsghdr *nlh;
}
}
status = recvfrom(h->fd, buf, len, 0,
- (struct sockaddr *)&h->peer, &addrlen);
+ (struct sockaddr *)&h->peer, &addrlen);
if (status < 0) {
lttctl_errno = LTTCTL_ERR_RECV;
memset(h, 0, sizeof(struct lttctl_handle));
- h->fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_LTT);
-
+ h->fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_LTT);
+
if (h->fd == -1) {
lttctl_errno = LTTCTL_ERR_SOCKET;
lttctl_perror("Create handle");
senderr:
lttctl_perror("Create Trace Error");
- err = EPERM;
+ err = EPERM;
return err;
}
senderr:
lttctl_perror("Destroy Trace Channels Error");
- err = EPERM;
+ err = EPERM;
return err;
}
return 0;
senderr:
- err = EPERM;
+ err = EPERM;
lttctl_perror("Start Trace Error");
return err;
return 0;
senderr:
- err = EPERM;
+ err = EPERM;
lttctl_perror("Stop Trace Error");
return err;
}
/* libltt header file
*
* Copyright 2005-
- * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
*
*
* This program is free software; you can redistribute it and/or modify
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
char trace_type[NAME_MAX];
enum trace_op op;
union {
- struct {
- enum trace_mode mode;
- unsigned subbuf_size;
- unsigned n_subbufs;
- } new_trace;
+ struct {
+ enum trace_mode mode;
+ unsigned subbuf_size;
+ unsigned n_subbufs;
+ } new_trace;
} args;
} lttctl_peer_msg_t;
struct lttctl_handle
{
- int fd;
- //u_int8_t blocking;
- struct sockaddr_nl local;
- struct sockaddr_nl peer;
+ int fd;
+ //u_int8_t blocking;
+ struct sockaddr_nl local;
+ struct sockaddr_nl peer;
};
typedef struct lttctl_resp_msg {