-/*
- * Basic session information.
- *
- * This is an 'output data' meaning that it only comes *from* the session
- * daemon *to* the lttng client. It's basically a 'human' representation of
- * tracing entities (here a session).
- *
- * The structures should be initialized to zero before use.
- */
-#define LTTNG_SESSION_PADDING1 12
-struct lttng_session {
- char name[NAME_MAX];
- /* The path where traces are written */
- char path[PATH_MAX];
- uint32_t enabled; /* enabled/started: 1, disabled/stopped: 0 */
- uint32_t snapshot_mode;
- unsigned int live_timer_interval; /* usec */
-
- char padding[LTTNG_SESSION_PADDING1];
-};
-
-/*
- * Handle used as a context for commands.
- *
- * The structures should be initialized to zero before use.
- */
-#define LTTNG_HANDLE_PADDING1 16
-struct lttng_handle {
- char session_name[NAME_MAX];
- struct lttng_domain domain;
-
- char padding[LTTNG_HANDLE_PADDING1];
-};
-
-/*
- * Public LTTng control API
- */
-
-/*
- * Create a tracing session using a name and an optional URL.
- *
- * If _url_ is NULL, no consumer is created for the session. The name can't be
- * NULL here.
- *
- * Return 0 on success else a negative LTTng error code.
- */
-extern int lttng_create_session(const char *name, const char *url);
-
-/*
- * Create a tracing session that will exclusively be used for snapshot meaning
- * the session will be in no output mode and every channel enabled for that
- * session will be set in overwrite mode and in mmap output since splice is not
- * supported.
- *
- * Name can't be NULL. If an url is given, it will be used to create a default
- * snapshot output using it as a destination. If NULL, no output will be
- * defined and an add-output call will be needed.
- *
- * Return 0 on success else a negative LTTng error code.
- */
-extern int lttng_create_session_snapshot(const char *name,
- const char *snapshot_url);
-
-/*
- * Create a session exclusively used for live reading.
- *
- * In this mode, the switch-timer parameter is forced for each UST channel, a
- * live-switch-timer is enabled for kernel channels, manually setting
- * switch-timer is forbidden. Synchronization beacons are sent to the relayd,
- * indexes are sent and metadata is checked for each packet.
- *
- * Name can't be NULL. If no URL is given, the default is to send the data to
- * net://127.0.0.1. The timer_interval is in usec and by default set to 1000000
- * (1 second).
- *
- * Return 0 on success else a negative LTTng error code.
- */
-extern int lttng_create_session_live(const char *name, const char *url,
- unsigned int timer_interval);
-
-/*
- * Create an handle used as a context for every request made to the library.
- *
- * This handle contains the session name and domain on which the command will
- * be executed. A domain is basically a tracer like the kernel or user space.
- *
- * Return an newly allocated handle that should be freed using
- * lttng_destroy_handle. On error, NULL is returned.
- */
-extern struct lttng_handle *lttng_create_handle(const char *session_name,
- struct lttng_domain *domain);
-
-/*
- * Destroy an handle that has been previously created with lttng_create_handle.
- *
- * It free the given pointer making it unusable.
- */
-extern void lttng_destroy_handle(struct lttng_handle *handle);
-
-/*
- * Destroy a tracing session.
- *
- * The session will not be usable, tracing will be stopped thus buffers will be
- * flushed.
- *
- * The name can't be NULL here.
- *
- * Return 0 on success else a negative LTTng error code.
- */
-extern int lttng_destroy_session(const char *name);
-
-/*
- * List all the tracing sessions.
- *
- * Return the size (number of entries) of the "lttng_session" array. Caller
- * must free sessions. On error, a negative LTTng error code is returned.
- */
-extern int lttng_list_sessions(struct lttng_session **sessions);
-
-/*
- * List the registered domain(s) of a session.
- *
- * Session name CAN NOT be NULL.
- *
- * Return the size (number of entries) of the "lttng_domain" array. Caller
- * must free domains. On error, a negative LTTng error code is returned.
- */
-extern int lttng_list_domains(const char *session_name,
- struct lttng_domain **domains);
-
-/*
- * List the channel(s) of a session.
- *
- * The handle CAN NOT be NULL.
- *
- * Return the size (number of entries) of the "lttng_channel" array. Caller
- * must free channels. On error, a negative LTTng error code is returned.
- */
-extern int lttng_list_channels(struct lttng_handle *handle,
- struct lttng_channel **channels);
-
-/*
- * List the event(s) of a session channel.
- *
- * Both handle and channel_name CAN NOT be NULL.
- *
- * Return the size (number of entries) of the "lttng_event" array. Caller must
- * free events. On error a negative LTTng error code is returned.
- */
-extern int lttng_list_events(struct lttng_handle *handle,
- const char *channel_name, struct lttng_event **events);
-
-/*
- * List the available tracepoints of a specific lttng domain.
- *
- * The handle CAN NOT be NULL.
- *
- * Return the size (number of entries) of the "lttng_event" array. Caller must
- * free events. On error a negative LTTng error code is returned.
- */
-extern int lttng_list_tracepoints(struct lttng_handle *handle,
- struct lttng_event **events);
-
-/*
- * List the available tracepoints fields of a specific lttng domain.
- *
- * The handle CAN NOT be NULL.
- *
- * Return the size (number of entries) of the "lttng_event_field" array.
- * Caller must free fields. On error a negative LTTng error code is
- * returned.
- */
-extern int lttng_list_tracepoint_fields(struct lttng_handle *handle,
- struct lttng_event_field **fields);
-