#define LTTNG_MAX_PID INT32_MAX
#define LTTNG_MAX_PID_STR "2147483647"
+#define LTTNG_NAME_MAX 255
+
#endif /* LTTNG_CONSTANT_H */
union {
pid_t pid;
- char exec_name[NAME_MAX];
+ char exec_name[LTTNG_NAME_MAX];
char padding[LTTNG_DOMAIN_PADDING2];
} attr;
};
*/
#define LTTNG_HANDLE_PADDING1 16
struct lttng_handle {
- char session_name[NAME_MAX];
+ char session_name[LTTNG_NAME_MAX];
struct lttng_domain domain;
char padding[LTTNG_HANDLE_PADDING1];
#include <limits.h>
#include <stdint.h>
+#include <lttng/constant.h>
#include <common/macros.h>
/*
*/
struct lttng_load_session_attr {
/* Name of the session to load, empty string means all. */
- char session_name[NAME_MAX];
+ char session_name[LTTNG_NAME_MAX];
/* URL of the session configuration file to load. */
char input_url[PATH_MAX];
/* Overwrite the session if it exists. */
#include <limits.h>
#include <stdint.h>
+#include <lttng/constant.h>
#include <common/macros.h>
/*
*/
struct lttng_save_session_attr {
/* Name of the session to save, empty string means all. */
- char session_name[NAME_MAX];
+ char session_name[LTTNG_NAME_MAX];
/* Destination of the session configuration. See lttng(1) for URL format. */
char configuration_url[PATH_MAX];
/* Overwrite the session configuration file if it exists. */
*/
#define LTTNG_SESSION_PADDING1 12
struct lttng_session {
- char name[NAME_MAX];
+ char name[LTTNG_NAME_MAX];
/* The path where traces are written */
char path[PATH_MAX];
uint32_t enabled; /* enabled/started: 1, disabled/stopped: 0 */
#include <limits.h>
#include <stdint.h>
+#include <lttng/constant.h>
/*
* Object used for the snapshot API. This is opaque to the public library.
*/
uint64_t max_size;
/* Name of the output so it can be recognized easily when listing them. */
- char name[NAME_MAX];
+ char name[LTTNG_NAME_MAX];
/* Destination of the output. See lttng(1) for URL format. */
char ctrl_url[PATH_MAX];
/* Destination of the output. See lttng(1) for URL format. */
int ret = 0, send_ret;
struct relay_session *session;
struct lttcomm_relayd_status_session reply;
- char session_name[NAME_MAX];
+ char session_name[LTTNG_NAME_MAX];
char hostname[HOST_NAME_MAX];
uint32_t live_timer = 0;
bool snapshot = false;
- memset(session_name, 0, NAME_MAX);
+ memset(session_name, 0, LTTNG_NAME_MAX);
memset(hostname, 0, HOST_NAME_MAX);
memset(&reply, 0, sizeof(reply));
#include <urcu/list.h>
#include <urcu/ref.h>
+#include <lttng/constant.h>
#include <common/hashtable/hashtable.h>
/*
* It is used to match a set of streams to their session.
*/
uint64_t id;
- char session_name[NAME_MAX];
+ char session_name[LTTNG_NAME_MAX];
char hostname[HOST_NAME_MAX];
uint32_t live_timer;
DBG("Tracefile %s/%s created", stream->path_name, stream->channel_name);
}
- if (!strncmp(stream->channel_name, DEFAULT_METADATA_NAME, NAME_MAX)) {
+ if (!strncmp(stream->channel_name, DEFAULT_METADATA_NAME, LTTNG_NAME_MAX)) {
stream->is_metadata = 1;
}
* Version information for the machine interface.
*/
struct mi_lttng_version {
- char version[NAME_MAX]; /* Version number of package */
+ char version[LTTNG_NAME_MAX]; /* Version number of package */
uint32_t version_major; /* LTTng-Tools major version number */
uint32_t version_minor; /* LTTng-Tools minor version number */
uint32_t version_patchlevel; /* LTTng-Tools patchlevel version number */
- char version_commit[NAME_MAX]; /* Commit hash of the current version */
- char version_name[NAME_MAX];
- char package_url[NAME_MAX]; /* Define to the home page for this package. */
+ char version_commit[LTTNG_NAME_MAX]; /* Commit hash of the current version */
+ char version_name[LTTNG_NAME_MAX];
+ char package_url[LTTNG_NAME_MAX]; /* Define to the home page for this package. */
};
/* Strings related to command */
* Create session in 2.4 adds additionnal parameters for live reading.
*/
struct lttcomm_relayd_create_session_2_4 {
- char session_name[NAME_MAX];
+ char session_name[LTTNG_NAME_MAX];
char hostname[HOST_NAME_MAX];
uint32_t live_timer;
uint32_t snapshot;
size_t len;
len = strlen(session_name);
- if (len >= NAME_MAX) {
+ if (len >= LTTNG_NAME_MAX) {
ret = -LTTNG_ERR_INVALID;
goto error;
}
size_t len;
len = strlen(session_name);
- if (len >= NAME_MAX) {
+ if (len >= LTTNG_NAME_MAX) {
ret = -LTTNG_ERR_INVALID;
goto error;
}