X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=libustctl%2Flibustctl.h;fp=libustctl%2Flibustctl.h;h=420d55409b5755e6e6fb935998d0a47c8d256c98;hp=0000000000000000000000000000000000000000;hb=62d3069fe1d56bf9f95f9100f21758c3d99dccf6;hpb=2e442863aa3cf0488f358461f3bfb87b2497d788 diff --git a/libustctl/libustctl.h b/libustctl/libustctl.h new file mode 100644 index 000000000..420d55409 --- /dev/null +++ b/libustctl/libustctl.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2009 Pierre-Marc Fournier + * 2011 David Goulet + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _LTT_LIBUSTCTL_H +#define _LTT_LIBUSTCTL_H + +#define USTCTL_ERR_CONN 1 /* Process connection error */ +#define USTCTL_ERR_ARG 2 /* Invalid function argument */ +#define USTCTL_ERR_GEN 3 /* General ustctl error */ + +#define USTCTL_MS_CHR_OFF '0' /* Marker state 'on' character */ +#define USTCTL_MS_CHR_ON '1' /* Marker state 'on' character */ +#define USTCTL_MS_OFF 0 /* Marker state 'on' value */ +#define USTCTL_MS_ON 1 /* Marker state 'on' value */ + +/* + * Channel/marker/state/format string (cmsf) data structure + */ +struct ustctl_marker_status { + char *channel; /* Channel name (end of ustctl_marker_status array if NULL) */ + char *ust_marker; /* Marker name (end of ustctl_marker_status array if NULL) */ + int state; /* State (0 := marker disabled, 1 := marker enabled) */ + char *fs; /* Format string (end of ustctl_marker_status array if NULL) */ +}; + +struct ustctl_trace_event_status { + char *name; +}; + +pid_t *ustctl_get_online_pids(void); + +int ustctl_alloc_trace(int sock, const char *trace); +int ustctl_connect_pid(pid_t pid); +int ustctl_create_trace(int sock, const char *trace); +int ustctl_destroy_trace(int sock, const char *trace); +int ustctl_force_switch(int sock, const char *trace); +int ustctl_free_cmsf(struct ustctl_marker_status *cmsf); +int ustctl_free_tes(struct ustctl_trace_event_status *tes); +int ustctl_get_cmsf(int sock, struct ustctl_marker_status **cmsf); +int ustctl_get_sock_path(int sock, char **sock_path); +int ustctl_get_subbuf_num(pid_t pid, const char *trace, const char *channel); +int ustctl_get_subbuf_size(int sock, const char *trace, const char *channel); +int ustctl_get_tes(int sock, struct ustctl_trace_event_status **tes); +int ustctl_set_sock_path(int sock, const char *sock_path); + +int ustctl_set_marker_state(int sock, const char *trace, + const char *channel, const char *ust_marker, int state); + +int ustctl_set_subbuf_size(int sock, const char *trace, + const char *channel, unsigned int subbuf_size); + +int ustctl_set_subbuf_num(int sock, const char *trace, + const char *channel, unsigned int num); + +int ustctl_setup_and_start(int sock, const char *trace); +int ustctl_start_trace(int sock, const char *trace); +int ustctl_stop_trace(int sock, const char *trace); +unsigned int ustctl_count_nl(const char *str); + +#endif /* _LTT_LIBUSTCTL_H */