X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=trunk%2Fltt-control%2Fliblttctl%2Flttctl.h;h=facc8f05f0b4ada702e936f0d6bc8970f49f4e8e;hb=354b34fd3862bb86f74ecfdcca471d6c66238b61;hp=053c0f47b94005478f03c446edaf3988334c6f82;hpb=f64efc67a081bb9013f5939ec9e4ca514cd94d0f;p=ltt-control.git diff --git a/trunk/ltt-control/liblttctl/lttctl.h b/trunk/ltt-control/liblttctl/lttctl.h index 053c0f4..facc8f0 100644 --- a/trunk/ltt-control/liblttctl/lttctl.h +++ b/trunk/ltt-control/liblttctl/lttctl.h @@ -14,86 +14,29 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * - * Inspired from iptables, by James Morris . - * */ #ifndef _LIBLTT_H #define _LIBLTT_H -#include -#include -#include -#include - -#ifndef NETLINK_LTT -#define NETLINK_LTT 31 -#endif - - -enum trace_op { - OP_CREATE, - OP_DESTROY, - OP_START, - OP_STOP, - OP_NONE -}; - -enum trace_mode { - LTT_TRACE_NORMAL, - LTT_TRACE_FLIGHT, - LTT_TRACE_HYBRID -}; - -typedef struct lttctl_peer_msg { - char trace_name[NAME_MAX]; - char trace_type[NAME_MAX]; - enum trace_op op; - union { - struct { - enum trace_mode mode; - unsigned subbuf_size_low; - unsigned n_subbufs_low; - unsigned subbuf_size_med; - unsigned n_subbufs_med; - unsigned subbuf_size_high; - unsigned n_subbufs_high; - } new_trace; - } args; -} lttctl_peer_msg_t; - - -struct lttctl_handle -{ - int fd; - //u_int8_t blocking; - struct sockaddr_nl local; - struct sockaddr_nl peer; -}; - -typedef struct lttctl_resp_msg { - int err; -} lttctl_resp_msg_t; - -struct lttctl_handle *lttctl_create_handle(void); - -int lttctl_destroy_handle(struct lttctl_handle *h); - - -int lttctl_create_trace(const struct lttctl_handle *h, - char *name, enum trace_mode mode, char *trace_type, - unsigned subbuf_size_low, unsigned n_subbufs_low, - unsigned subbuf_size_med, unsigned n_subbufs_med, - unsigned subbuf_size_high, unsigned n_subbufs_high); - -int lttctl_destroy_trace(const struct lttctl_handle *handle, char *name); - -int lttctl_start(const struct lttctl_handle *handle, char *name); - -int lttctl_stop(const struct lttctl_handle *handle, char *name); - -#define LTTCTLM_BASE 0x10 -#define LTTCTLM_CONTROL (LTTCTLM_BASE + 1) /* LTT control message */ - -#endif //_LIBLTT_H +int lttctl_init(void); +int lttctl_destroy(void); +int lttctl_setup_trace(const char *name); +int lttctl_destroy_trace(const char *name); +int lttctl_alloc_trace(const char *name); +int lttctl_start(const char *name); +int lttctl_pause(const char *name); +int lttctl_set_trans(const char *name, const char *trans); +int lttctl_set_channel_enable(const char *name, const char *channel, + int enable); +int lttctl_set_channel_overwrite(const char *name, const char *channel, + int overwrite); +int lttctl_set_channel_subbuf_num(const char *name, const char *channel, + unsigned subbuf_num); +int lttctl_set_channel_subbuf_size(const char *name, const char *channel, + unsigned subbuf_size); + +/* Helper functions */ +int getdebugfsmntdir(char *mntdir); + +#endif /*_LIBLTT_H */