From: David Goulet Date: Fri, 27 May 2011 19:51:45 +0000 (-0400) Subject: Cleanup lttng.h public header X-Git-Tag: v2.0-pre1~106 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b738434783af68bc4f8a0de9b97e89e58c30f16e;p=lttng-tools.git Cleanup lttng.h public header Signed-off-by: David Goulet --- diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index a1ccc451e..8811e197a 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -1,4 +1,8 @@ /* + * lttng.h + * + * Linux Trace Toolkit Control Library Header File + * * Copyright (C) 2011 - David Goulet * * This program is free software; you can redistribute it and/or @@ -16,73 +20,80 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _LIBLTTNGCTL_H -#define _LIBLTTNGCTL_H +#ifndef _LTTNG_H +#define _LTTNG_H #include -#include #include -/* Default unix group name for tracing. - */ -#define DEFAULT_TRACING_GROUP "tracing" +/* Default unix group name for tracing. */ +#define LTTNG_DEFAULT_TRACING_GROUP "tracing" -/* Environment variable to set session daemon - * binary path. - */ +/* Environment variable to set session daemon binary path. */ #define LTTNG_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH" -/* UUID string length (including \0) */ -#define UUID_STR_LEN 37 -/* UUID short string version length (including \0) */ -#define UUID_SHORT_STR_LEN 9 - -/* Trace type for lttng_trace. +/* + * Trace type for lttng_trace. */ enum lttng_trace_type { - KERNEL, USERSPACE, + KERNEL, + USERSPACE, }; -/* Simple structure representing a session. +/* + * Basic trace information exposed. */ -struct lttng_session { +struct lttng_trace { char name[NAME_MAX]; - uuid_t uuid; + pid_t pid; /* Only useful for user-space trace */ + enum lttng_trace_type type; }; -/* Simple trace representation. +/* + * Basic session information exposed. */ -struct lttng_trace { +struct lttng_session { char name[NAME_MAX]; - pid_t pid; - enum lttng_trace_type type; + uuid_t uuid; }; +/* + * Session daemon control + */ +extern int lttng_check_session_daemon(void); +extern int lttng_connect_sessiond(void); extern int lttng_create_session(char *name); extern int lttng_destroy_session(uuid_t *uuid); -extern int lttng_connect_sessiond(void); extern int lttng_disconnect_sessiond(void); -extern int lttng_set_tracing_group(const char *name); -extern int lttng_check_session_daemon(void); -extern const char *lttng_get_readable_code(int code); -extern int lttng_ust_list_apps(pid_t **pids); +/* Return an allocated array of lttng_session */ extern int lttng_list_sessions(struct lttng_session **sessions); +/* Return an allocated array of lttng_traces */ extern int lttng_list_traces(uuid_t *uuid, struct lttng_trace **traces); +/* Set tracing group for the current execution */ +extern int lttng_set_tracing_group(const char *name); +/* Set session uuid for the current execution */ extern void lttng_set_current_session_uuid(uuid_t *uuid); +extern const char *lttng_get_readable_code(int code); + +/* + * User-space tracer control + */ extern int lttng_ust_create_trace(pid_t pid); +/* Return an allocated array of pids */ +extern int lttng_ust_list_apps(pid_t **pids); extern int lttng_ust_start_trace(pid_t pid); extern int lttng_ust_stop_trace(pid_t pid); /* * Kernel tracer control */ -extern int lttng_kernel_enable_event(char *event_name); -extern int lttng_kernel_disable_event(char *event_name); -extern int lttng_kernel_create_session(void); -extern int lttng_kernel_start_tracing(void); -extern int lttng_kernel_stop_tracing(void); extern int lttng_kernel_create_channel(void); +extern int lttng_kernel_create_session(void); extern int lttng_kernel_create_stream(void); +extern int lttng_kernel_disable_event(char *event_name); +extern int lttng_kernel_enable_event(char *event_name); extern int lttng_kernel_open_metadata(void); +extern int lttng_kernel_start_tracing(void); +extern int lttng_kernel_stop_tracing(void); -#endif /* _LIBLTTNGCTL_H */ +#endif /* _LTTNG_H */