| 1 | /* |
| 2 | * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License, version 2 only, |
| 6 | * as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along |
| 14 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 15 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 16 | */ |
| 17 | |
| 18 | #ifndef LTTNG_SESSIOND_CONFIG_H |
| 19 | #define LTTNG_SESSIOND_CONFIG_H |
| 20 | |
| 21 | #include <common/macros.h> |
| 22 | #include <stdbool.h> |
| 23 | |
| 24 | struct config_string { |
| 25 | char *value; |
| 26 | bool should_free; |
| 27 | }; |
| 28 | |
| 29 | /* Config string takes ownership of value. */ |
| 30 | LTTNG_HIDDEN |
| 31 | void config_string_set(struct config_string *string, char *value); |
| 32 | |
| 33 | struct sessiond_config { |
| 34 | int verbose; |
| 35 | int verbose_consumer; |
| 36 | /* Agent TCP port for registration. Used by the agent thread. */ |
| 37 | int agent_tcp_port; |
| 38 | /* Socket timeout for receiving and sending (in seconds). */ |
| 39 | int app_socket_timeout; |
| 40 | |
| 41 | bool quiet; |
| 42 | bool no_kernel; |
| 43 | bool background; |
| 44 | bool daemonize; |
| 45 | bool sig_parent; |
| 46 | |
| 47 | struct config_string tracing_group_name; |
| 48 | |
| 49 | struct config_string kmod_probes_list; |
| 50 | struct config_string kmod_extra_probes_list; |
| 51 | |
| 52 | struct config_string rundir; |
| 53 | |
| 54 | /* Global application Unix socket path */ |
| 55 | struct config_string apps_unix_sock_path; |
| 56 | /* Global client Unix socket path */ |
| 57 | struct config_string client_unix_sock_path; |
| 58 | /* Global wait shm path for UST */ |
| 59 | struct config_string wait_shm_path; |
| 60 | /* Global health check unix path */ |
| 61 | struct config_string health_unix_sock_path; |
| 62 | /* |
| 63 | * LTTNG_UST_CLOCK_PLUGIN environment variable to be passed to spawned |
| 64 | * consumer daemons. |
| 65 | */ |
| 66 | struct config_string lttng_ust_clock_plugin; |
| 67 | struct config_string pid_file_path; |
| 68 | struct config_string lock_file_path; |
| 69 | struct config_string load_session_path; |
| 70 | struct config_string agent_port_file_path; |
| 71 | |
| 72 | struct config_string consumerd32_path; |
| 73 | struct config_string consumerd32_bin_path; |
| 74 | struct config_string consumerd32_lib_dir; |
| 75 | struct config_string consumerd32_err_unix_sock_path; |
| 76 | struct config_string consumerd32_cmd_unix_sock_path; |
| 77 | |
| 78 | struct config_string consumerd64_path; |
| 79 | struct config_string consumerd64_bin_path; |
| 80 | struct config_string consumerd64_lib_dir; |
| 81 | struct config_string consumerd64_err_unix_sock_path; |
| 82 | struct config_string consumerd64_cmd_unix_sock_path; |
| 83 | |
| 84 | struct config_string kconsumerd_path; |
| 85 | struct config_string kconsumerd_err_unix_sock_path; |
| 86 | struct config_string kconsumerd_cmd_unix_sock_path; |
| 87 | }; |
| 88 | |
| 89 | /* Initialize the sessiond_config values to build-defaults. */ |
| 90 | LTTNG_HIDDEN |
| 91 | int sessiond_config_init(struct sessiond_config *config); |
| 92 | |
| 93 | /* Override sessiond_config values with values specified by the environment. */ |
| 94 | LTTNG_HIDDEN |
| 95 | int sessiond_config_apply_env_config(struct sessiond_config *config); |
| 96 | |
| 97 | LTTNG_HIDDEN |
| 98 | void sessiond_config_fini(struct sessiond_config *config); |
| 99 | |
| 100 | LTTNG_HIDDEN |
| 101 | int sessiond_config_resolve_paths(struct sessiond_config *config); |
| 102 | |
| 103 | LTTNG_HIDDEN |
| 104 | void sessiond_config_log(struct sessiond_config *config); |
| 105 | |
| 106 | #endif /* LTTNG_SESSIOND_CONFIG_H */ |