X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsessiond-config.c;h=707e57950f69ed5635bd46ab874624c84e0bb8c0;hb=3a2434036c2e836d58bfa5b89ba47b5898d86d35;hp=7ab1f5d7bc1c005afe3820a72b2d9ea1e8bd3456;hpb=a3bc3918a3e9f219cc54adcc41dd6b37381b30ff;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/sessiond-config.c b/src/bin/lttng-sessiond/sessiond-config.c index 7ab1f5d7b..707e57950 100644 --- a/src/bin/lttng-sessiond/sessiond-config.c +++ b/src/bin/lttng-sessiond/sessiond-config.c @@ -1,30 +1,19 @@ /* - * Copyright (C) 2017 - Jérémie Galarneau + * Copyright (C) 2017 Jérémie Galarneau * - * 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 #include "lttng-ust-ctl.h" #include #include -#include #include #include #include +#include #include static @@ -34,6 +23,8 @@ struct sessiond_config sessiond_config_build_defaults = { .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, @@ -41,7 +32,7 @@ struct sessiond_config sessiond_config_build_defaults = { .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, @@ -89,10 +80,9 @@ void config_string_set_static(struct config_string *config_str, } /* 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; @@ -102,7 +92,6 @@ void config_string_set(struct config_string *config_str, char *value) config_str->value = value; } -LTTNG_HIDDEN int sessiond_config_apply_env_config(struct sessiond_config *config) { int ret = 0; @@ -255,14 +244,13 @@ end: 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) { @@ -410,7 +398,6 @@ error: return ret; } -LTTNG_HIDDEN void sessiond_config_fini(struct sessiond_config *config) { config_string_fini(&config->tracing_group_name); @@ -466,7 +453,6 @@ end: 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); @@ -494,7 +480,6 @@ int sessiond_config_resolve_paths(struct sessiond_config *config) return 0; } -LTTNG_HIDDEN void sessiond_config_log(struct sessiond_config *config) { DBG_NO_LOC("[sessiond configuration]"); @@ -508,6 +493,9 @@ void sessiond_config_log(struct sessiond_config *config) 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");