X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Flttng%2Flttng.h;h=404a80117d50188f4d48491c7e65324862197087;hb=49cddecdbb1e042877ca3855b177ade68151030f;hp=85d13c9029d9c7d887506b30d7af9286683637d2;hpb=1239a312e7e0e4c33948fdaf04e7637cb93c8b10;p=lttng-tools.git diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 85d13c902..404a80117 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -3,20 +3,10 @@ * * Linux Trace Toolkit Control Library Header File * - * Copyright (C) 2011 - David Goulet + * Copyright (C) 2011 EfficiOS Inc. * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License, version 2.1 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: LGPL-2.1-only * - * 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 LTTNG_H @@ -26,37 +16,75 @@ #include /* Include every LTTng ABI/API available. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include +#include +#include +#include #ifdef __cplusplus extern "C" { #endif -/* Health component for the health check function. */ -enum lttng_health_component { - LTTNG_HEALTH_CMD, - LTTNG_HEALTH_APP_MANAGE, - LTTNG_HEALTH_APP_REG, - LTTNG_HEALTH_KERNEL, - LTTNG_HEALTH_CONSUMER, - LTTNG_HEALTH_HT_CLEANUP, - LTTNG_HEALTH_APP_MANAGE_NOTIFY, - LTTNG_HEALTH_APP_REG_DISPATCH, - LTTNG_HEALTH_ALL, +enum lttng_calibrate_type { + LTTNG_CALIBRATE_FUNCTION = 0, }; -enum lttng_calibrate_type { - LTTNG_CALIBRATE_FUNCTION = 0, +/* Machine interface output type */ +enum lttng_mi_output_type { + LTTNG_MI_XML = 1 /* XML output */ }; -#define LTTNG_CALIBRATE_PADDING1 16 +#define LTTNG_CALIBRATE_PADDING1 16 struct lttng_calibrate { enum lttng_calibrate_type type; @@ -69,14 +97,14 @@ struct lttng_calibrate { * Return 1 if alive or 0 if not. On error, returns a negative negative LTTng * error code. */ -extern int lttng_session_daemon_alive(void); +LTTNG_EXPORT extern int lttng_session_daemon_alive(void); /* * Set the tracing group for the *current* flow of execution. * * On success, returns 0 else a negative LTTng error code. */ -extern int lttng_set_tracing_group(const char *name); +LTTNG_EXPORT extern int lttng_set_tracing_group(const char *name); /* * This call registers an "outside consumer" for a session and an lttng domain. @@ -88,15 +116,15 @@ extern int lttng_set_tracing_group(const char *name); * * Return 0 on success else a negative LTTng error code. */ -extern int lttng_register_consumer(struct lttng_handle *handle, - const char *socket_path); +LTTNG_EXPORT extern int lttng_register_consumer(struct lttng_handle *handle, + const char *socket_path); /* * Start tracing for *all* domain(s) in the session. * * Return 0 on success else a negative LTTng error code. */ -extern int lttng_start_tracing(const char *session_name); +LTTNG_EXPORT extern int lttng_start_tracing(const char *session_name); /* * Stop tracing for *all* domain(s) in the session. @@ -110,23 +138,23 @@ extern int lttng_start_tracing(const char *session_name); * * Return 0 on success else a negative LTTng error code. */ -extern int lttng_stop_tracing(const char *session_name); +LTTNG_EXPORT extern int lttng_stop_tracing(const char *session_name); /* * Behave exactly like lttng_stop_tracing but does not wait for data * availability. */ -extern int lttng_stop_tracing_no_wait(const char *session_name); +LTTNG_EXPORT extern int lttng_stop_tracing_no_wait(const char *session_name); /* - * Calibrate LTTng overhead. - * - * The chan and handle params can not be NULL. - * - * Return 0 on success else a negative LTTng error code. + * Deprecated: As of LTTng 2.9, this function always returns + * -LTTNG_ERR_UND. */ -extern int lttng_calibrate(struct lttng_handle *handle, - struct lttng_calibrate *calibrate); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +LTTNG_EXPORT extern int lttng_calibrate(struct lttng_handle *handle, + struct lttng_calibrate *calibrate); +#pragma GCC diagnostic pop /* * Set URL for a consumer for a session and domain. @@ -152,47 +180,50 @@ extern int lttng_calibrate(struct lttng_handle *handle, * * Return 0 on success else a negative LTTng error code. */ -extern int lttng_set_consumer_url(struct lttng_handle *handle, - const char *control_url, const char *data_url); +LTTNG_EXPORT extern int +lttng_set_consumer_url(struct lttng_handle *handle, const char *control_url, const char *data_url); /* - * Enable the consumer for a session and domain. + * For a given session name, this call checks if the data is ready to be read + * or is still being extracted by the consumer(s) (pending) hence not ready to + * be used by any readers. + * + * Return 0 if there is _no_ data pending in the buffers thus having a + * guarantee that the data can be read safely. Else, return 1 if there is still + * traced data is pending. On error, a negative value is returned and readable + * by lttng_strerror(). */ -extern LTTNG_DEPRECATED("This call is now obsolete.") -int lttng_enable_consumer(struct lttng_handle *handle); +LTTNG_EXPORT extern int lttng_data_pending(const char *session_name); /* - * Disable consumer for a session and domain. + * Gets the status of the kernel tracer. + * + * Sets the value of the argument, which must not be null. */ -extern LTTNG_DEPRECATED("This call is now obsolete.") -int lttng_disable_consumer(struct lttng_handle *handle); +LTTNG_EXPORT extern enum lttng_error_code lttng_get_kernel_tracer_status(enum lttng_kernel_tracer_status *status); /* - * Check session daemon health for a specific component. - * - * Return 0 if health is OK or 1 if BAD. A returned value of -1 indicate that - * the control library was not able to connect to the session daemon health - * socket. - * - * Any other positive value is an lttcomm error which can be translate with - * lttng_strerror(). - * - * Please see lttng-health-check(3) man page for more information. + * Deprecated, replaced by lttng_regenerate_metadata. */ -extern LTTNG_DEPRECATED("This call is now obsolete.") -int lttng_health_check(enum lttng_health_component c); +LTTNG_DEPRECATED("Use lttng_regenerate_metadata") +LTTNG_EXPORT extern int lttng_metadata_regenerate(const char *session_name); /* - * For a given session name, this call checks if the data is ready to be read - * or is still being extracted by the consumer(s) (pending) hence not ready to - * be used by any readers. + * Trigger the regeneration of the metadata for a session. + * The new metadata overwrite the previous one locally or remotely (through + * the lttng-relayd). Only kernel, per-uid and non-live sessions are supported. + * Return 0 on success, a negative LTTng error code on error. + */ +LTTNG_EXPORT extern int lttng_regenerate_metadata(const char *session_name); + +/* + * Trigger the regeneration of the statedump for a session. The new statedump + * information is appended to the currently active trace, the session needs to + * be active. * - * Return 0 if there is _no_ data pending in the buffers thus having a - * guarantee that the data can be read safely. Else, return 1 if there is still - * traced data is pending. On error, a negative value is returned and readable - * by lttng_strerror(). + * Return 0 on success, a negative LTTng error code on error. */ -extern int lttng_data_pending(const char *session_name); +LTTNG_EXPORT extern int lttng_regenerate_statedump(const char *session_name); #ifdef __cplusplus }