/*
- * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "version.h"
#include "sessiond-config.h"
-#include <assert.h>
#include "lttng-ust-ctl.h"
#include <common/defaults.h>
#include <limits.h>
-#include <errno.h>
#include <ctype.h>
#include <common/error.h>
#include <common/utils.h>
+#include <common/compat/errno.h>
#include <common/compat/getenv.h>
static
.verbose_consumer = 0,
.agent_tcp_port = { .begin = DEFAULT_AGENT_TCP_PORT_RANGE_BEGIN, .end = DEFAULT_AGENT_TCP_PORT_RANGE_END },
+ .event_notifier_buffer_size_kernel = DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE,
+ .event_notifier_buffer_size_userspace = DEFAULT_EVENT_NOTIFIER_ERROR_COUNT_MAP_SIZE,
.app_socket_timeout = DEFAULT_APP_SOCKET_RW_TIMEOUT,
.no_kernel = false,
.daemonize = false,
.sig_parent = false,
- .tracing_group_name.value = DEFAULT_TRACING_GROUP,
+ .tracing_group_name.value = (char *) DEFAULT_TRACING_GROUP,
.kmod_probes_list.value = NULL,
.kmod_extra_probes_list.value = NULL,
}
/* Only use for dynamically-allocated strings. */
-LTTNG_HIDDEN
void config_string_set(struct config_string *config_str, char *value)
{
- assert(config_str);
+ LTTNG_ASSERT(config_str);
if (config_str->should_free) {
free(config_str->value);
config_str->should_free = false;
config_str->value = value;
}
-LTTNG_HIDDEN
int sessiond_config_apply_env_config(struct sessiond_config *config)
{
int ret = 0;
return ret;
}
-LTTNG_HIDDEN
int sessiond_config_init(struct sessiond_config *config)
{
int ret;
bool is_root = (getuid() == 0);
char *str;
- assert(config);
+ LTTNG_ASSERT(config);
memcpy(config, &sessiond_config_build_defaults, sizeof(*config));
if (is_root) {
return ret;
}
-LTTNG_HIDDEN
void sessiond_config_fini(struct sessiond_config *config)
{
config_string_fini(&config->tracing_group_name);
config_string_fini(&config->kmod_probes_list);
config_string_fini(&config->kmod_extra_probes_list);
+ config_string_fini(&config->rundir);
config_string_fini(&config->apps_unix_sock_path);
config_string_fini(&config->client_unix_sock_path);
config_string_fini(&config->wait_shm_path);
if (resolve_path(path_config_str)) \
return -1
-LTTNG_HIDDEN
int sessiond_config_resolve_paths(struct sessiond_config *config)
{
RESOLVE_CHECK(&config->apps_unix_sock_path);
return 0;
}
-LTTNG_HIDDEN
void sessiond_config_log(struct sessiond_config *config)
{
DBG_NO_LOC("[sessiond configuration]");
+ DBG_NO_LOC("\tversion %s", VERSION);
+ if (GIT_VERSION[0] != '\0') {
+ DBG_NO_LOC("\tgit version %s", GIT_VERSION);
+ }
+ if (EXTRA_VERSION_NAME[0] != '\0') {
+ DBG_NO_LOC("\textra version name %s", EXTRA_VERSION_NAME);
+ }
+ if (EXTRA_VERSION_DESCRIPTION[0] != '\0') {
+ DBG_NO_LOC("\textra version description:\n\t%s", EXTRA_VERSION_DESCRIPTION);
+ }
+ if (EXTRA_VERSION_PATCHES[0] != '\0') {
+ DBG_NO_LOC("\textra version patches:\n\t%s", EXTRA_VERSION_PATCHES);
+ }
DBG_NO_LOC("\tverbose: %i", config->verbose);
DBG_NO_LOC("\tverbose consumer: %i", config->verbose_consumer);
DBG_NO_LOC("\tquiet mode: %s", config->quiet ? "True" : "False");