clang-tidy: add most bugprone warnings
[lttng-tools.git] / src / bin / lttng-sessiond / main.cpp
index 23136f7c8deab6aa4677d51b9b40908b0c76edfd..cc32856198c3de9f0aac3c7bda84caf1d5b89564 100644 (file)
@@ -8,8 +8,61 @@
  */
 
 #define _LGPL_SOURCE
+#include "agent-thread.hpp"
+#include "agent.hpp"
+#include "buffer-registry.hpp"
+#include "channel.hpp"
+#include "client.hpp"
+#include "cmd.hpp"
+#include "consumer.hpp"
+#include "context.hpp"
+#include "dispatch.hpp"
+#include "event-notifier-error-accounting.hpp"
+#include "event.hpp"
+#include "fd-limit.hpp"
+#include "health-sessiond.hpp"
+#include "kernel-consumer.hpp"
+#include "kernel.hpp"
+#include "lttng-sessiond.hpp"
+#include "lttng-ust-ctl.hpp"
+#include "manage-apps.hpp"
+#include "manage-kernel.hpp"
+#include "modprobe.hpp"
+#include "notification-thread-commands.hpp"
+#include "notification-thread.hpp"
+#include "notify-apps.hpp"
+#include "register.hpp"
+#include "rotation-thread.hpp"
+#include "save.hpp"
+#include "sessiond-config.hpp"
+#include "testpoint.hpp"
+#include "thread.hpp"
+#include "timer.hpp"
+#include "ust-consumer.hpp"
+#include "ust-sigbus.hpp"
+#include "utils.hpp"
+
+#include <common/common.hpp>
+#include <common/compat/getenv.hpp>
+#include <common/compat/socket.hpp>
+#include <common/config/session-config.hpp>
+#include <common/daemonize.hpp>
+#include <common/defaults.hpp>
+#include <common/dynamic-buffer.hpp>
+#include <common/futex.hpp>
+#include <common/ini-config/ini-config.hpp>
+#include <common/kernel-consumer/kernel-consumer.hpp>
+#include <common/logging-utils.hpp>
+#include <common/path.hpp>
+#include <common/relayd/relayd.hpp>
+#include <common/utils.hpp>
+
+#include <lttng/event-internal.hpp>
+
+#include <ctype.h>
 #include <getopt.h>
 #include <grp.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <paths.h>
 #include <pthread.h>
@@ -17,7 +70,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/mman.h>
 #include <sys/mount.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <urcu/uatomic.h>
 #include <unistd.h>
-#include <ctype.h>
-
-#include <common/common.hpp>
-#include <common/compat/socket.hpp>
-#include <common/compat/getenv.hpp>
-#include <common/defaults.hpp>
-#include <common/kernel-consumer/kernel-consumer.hpp>
-#include <common/futex.hpp>
-#include <common/relayd/relayd.hpp>
-#include <common/utils.hpp>
-#include <common/path.hpp>
-#include <common/daemonize.hpp>
-#include <common/config/session-config.hpp>
-#include <common/ini-config/ini-config.hpp>
-#include <common/dynamic-buffer.hpp>
-#include <lttng/event-internal.hpp>
-#include "lttng-sessiond.hpp"
-#include "buffer-registry.hpp"
-#include "channel.hpp"
-#include "cmd.hpp"
-#include "consumer.hpp"
-#include "context.hpp"
-#include "event.hpp"
-#include "event-notifier-error-accounting.hpp"
-#include "kernel.hpp"
-#include "kernel-consumer.hpp"
-#include "lttng-ust-ctl.hpp"
-#include "ust-consumer.hpp"
-#include "utils.hpp"
-#include "fd-limit.hpp"
-#include "health-sessiond.hpp"
-#include "testpoint.hpp"
-#include "notify-apps.hpp"
-#include "agent-thread.hpp"
-#include "save.hpp"
-#include "notification-thread.hpp"
-#include "notification-thread-commands.hpp"
-#include "rotation-thread.hpp"
-#include "agent.hpp"
-#include "sessiond-config.hpp"
-#include "timer.hpp"
-#include "thread.hpp"
-#include "client.hpp"
-#include "dispatch.hpp"
-#include "register.hpp"
-#include "manage-apps.hpp"
-#include "manage-kernel.hpp"
-#include "modprobe.hpp"
-#include "ust-sigbus.hpp"
+#include <urcu/uatomic.h>
 
 static const char *help_msg =
 #ifdef LTTNG_EMBED_HELP
 #include <lttng-sessiond.8.h>
 #else
-NULL
+       nullptr
 #endif
-;
+       ;
 
 #define EVENT_NOTIFIER_ERROR_COUNTER_NUMBER_OF_BUCKET_MAX 65535
-#define EVENT_NOTIFIER_ERROR_BUFFER_SIZE_BASE_OPTION_STR \
-               "event-notifier-error-buffer-size"
+#define EVENT_NOTIFIER_ERROR_BUFFER_SIZE_BASE_OPTION_STR  "event-notifier-error-buffer-size"
 #define EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR \
-               EVENT_NOTIFIER_ERROR_BUFFER_SIZE_BASE_OPTION_STR "-kernel"
+       EVENT_NOTIFIER_ERROR_BUFFER_SIZE_BASE_OPTION_STR "-kernel"
 #define EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR \
-               EVENT_NOTIFIER_ERROR_BUFFER_SIZE_BASE_OPTION_STR "-userspace"
-
+       EVENT_NOTIFIER_ERROR_BUFFER_SIZE_BASE_OPTION_STR "-userspace"
 
 const char *progname;
 static int lockfile_fd = -1;
@@ -103,37 +104,37 @@ static int recv_child_signal;
 
 /* Command line options */
 static const struct option long_options[] = {
-       { "client-sock", required_argument, 0, 'c' },
-       { "apps-sock", required_argument, 0, 'a' },
-       { "kconsumerd-cmd-sock", required_argument, 0, '\0' },
-       { "kconsumerd-err-sock", required_argument, 0, '\0' },
-       { "ustconsumerd32-cmd-sock", required_argument, 0, '\0' },
-       { "ustconsumerd32-err-sock", required_argument, 0, '\0' },
-       { "ustconsumerd64-cmd-sock", required_argument, 0, '\0' },
-       { "ustconsumerd64-err-sock", required_argument, 0, '\0' },
-       { "consumerd32-path", required_argument, 0, '\0' },
-       { "consumerd32-libdir", required_argument, 0, '\0' },
-       { "consumerd64-path", required_argument, 0, '\0' },
-       { "consumerd64-libdir", required_argument, 0, '\0' },
-       { "daemonize", no_argument, 0, 'd' },
-       { "background", no_argument, 0, 'b' },
-       { "sig-parent", no_argument, 0, 'S' },
-       { "help", no_argument, 0, 'h' },
-       { "group", required_argument, 0, 'g' },
-       { "version", no_argument, 0, 'V' },
-       { "quiet", no_argument, 0, 'q' },
-       { "verbose", no_argument, 0, 'v' },
-       { "verbose-consumer", no_argument, 0, '\0' },
-       { "no-kernel", no_argument, 0, '\0' },
-       { "pidfile", required_argument, 0, 'p' },
-       { "agent-tcp-port", required_argument, 0, '\0' },
-       { "config", required_argument, 0, 'f' },
-       { "load", required_argument, 0, 'l' },
-       { "kmod-probes", required_argument, 0, '\0' },
-       { "extra-kmod-probes", required_argument, 0, '\0' },
-       { EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR, required_argument, 0, '\0' },
-       { EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR, required_argument, 0, '\0' },
-       { NULL, 0, 0, 0 }
+       { "client-sock", required_argument, nullptr, 'c' },
+       { "apps-sock", required_argument, nullptr, 'a' },
+       { "kconsumerd-cmd-sock", required_argument, nullptr, '\0' },
+       { "kconsumerd-err-sock", required_argument, nullptr, '\0' },
+       { "ustconsumerd32-cmd-sock", required_argument, nullptr, '\0' },
+       { "ustconsumerd32-err-sock", required_argument, nullptr, '\0' },
+       { "ustconsumerd64-cmd-sock", required_argument, nullptr, '\0' },
+       { "ustconsumerd64-err-sock", required_argument, nullptr, '\0' },
+       { "consumerd32-path", required_argument, nullptr, '\0' },
+       { "consumerd32-libdir", required_argument, nullptr, '\0' },
+       { "consumerd64-path", required_argument, nullptr, '\0' },
+       { "consumerd64-libdir", required_argument, nullptr, '\0' },
+       { "daemonize", no_argument, nullptr, 'd' },
+       { "background", no_argument, nullptr, 'b' },
+       { "sig-parent", no_argument, nullptr, 'S' },
+       { "help", no_argument, nullptr, 'h' },
+       { "group", required_argument, nullptr, 'g' },
+       { "version", no_argument, nullptr, 'V' },
+       { "quiet", no_argument, nullptr, 'q' },
+       { "verbose", no_argument, nullptr, 'v' },
+       { "verbose-consumer", no_argument, nullptr, '\0' },
+       { "no-kernel", no_argument, nullptr, '\0' },
+       { "pidfile", required_argument, nullptr, 'p' },
+       { "agent-tcp-port", required_argument, nullptr, '\0' },
+       { "config", required_argument, nullptr, 'f' },
+       { "load", required_argument, nullptr, 'l' },
+       { "kmod-probes", required_argument, nullptr, '\0' },
+       { "extra-kmod-probes", required_argument, nullptr, '\0' },
+       { EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR, required_argument, nullptr, '\0' },
+       { EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR, required_argument, nullptr, '\0' },
+       { nullptr, 0, nullptr, 0 }
 };
 
 /* Command line options to ignore from configuration file */
@@ -160,7 +161,7 @@ static struct ust_cmd_queue ust_cmd_queue;
 /*
  * Section name to look for in the daemon configuration file.
  */
-static const char * const config_section_name = "sessiond";
+static const char *const config_section_name = "sessiond";
 
 /* Am I root or not. Set to 1 if the daemon is running as root */
 static int is_root;
@@ -169,7 +170,7 @@ static int is_root;
  * Notify the main thread to initiate the teardown of the worker threads by
  * writing to the main quit pipe.
  */
-static void notify_main_quit_pipe(void)
+static void notify_main_quit_pipe()
 {
        int ret;
 
@@ -184,7 +185,7 @@ static void notify_main_quit_pipe(void)
 /*
  * Close every consumer sockets.
  */
-static void close_consumer_sockets(void)
+static void close_consumer_sockets()
 {
        int ret;
 
@@ -259,14 +260,12 @@ static void wait_consumer(struct consumer_data *consumer_data)
                return;
        }
 
-       DBG("Waiting for complete teardown of consumerd (PID: %d)",
-                       consumer_data->pid);
+       DBG("Waiting for complete teardown of consumerd (PID: %d)", consumer_data->pid);
        ret = waitpid(consumer_data->pid, &status, 0);
        if (ret == -1) {
                PERROR("consumerd waitpid pid: %d", consumer_data->pid)
-       } else  if (!WIFEXITED(status)) {
-               ERR("consumerd termination with error: %d",
-                               WEXITSTATUS(ret));
+       } else if (!WIFEXITED(status)) {
+               ERR("consumerd termination with error: %d", WEXITSTATUS(ret));
        }
        consumer_data->pid = 0;
 }
@@ -274,7 +273,7 @@ static void wait_consumer(struct consumer_data *consumer_data)
 /*
  * Cleanup the session daemon's data structures.
  */
-static void sessiond_cleanup(void)
+static void sessiond_cleanup()
 {
        int ret;
        struct ltt_session_list *session_list = session_get_list();
@@ -297,8 +296,7 @@ static void sessiond_cleanup(void)
                PERROR("remove pidfile %s", the_config.pid_file_path.value);
        }
 
-       DBG("Removing sessiond and consumerd content of directory %s",
-                       the_config.rundir.value);
+       DBG("Removing sessiond and consumerd content of directory %s", the_config.rundir.value);
 
        /* sessiond */
        DBG("Removing %s", the_config.pid_file_path.value);
@@ -359,7 +357,7 @@ static void sessiond_cleanup(void)
 /*
  * Cleanup the daemon's option data structures.
  */
-static void sessiond_cleanup_options(void)
+static void sessiond_cleanup_options()
 {
        DBG("Cleaning up options");
 
@@ -390,10 +388,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "-c, --client-sock");
+                            "-c, --client-sock");
                } else {
-                       config_string_set(&the_config.client_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.client_unix_sock_path, strdup(arg));
                        if (!the_config.client_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -406,10 +403,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "-a, --apps-sock");
+                            "-a, --apps-sock");
                } else {
-                       config_string_set(&the_config.apps_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.apps_unix_sock_path, strdup(arg));
                        if (!the_config.apps_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -426,10 +422,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "-g, --group");
+                            "-g, --group");
                } else {
-                       config_string_set(&the_config.tracing_group_name,
-                                       strdup(arg));
+                       config_string_set(&the_config.tracing_group_name, strdup(arg));
                        if (!the_config.tracing_group_name.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -453,11 +448,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--kconsumerd-err-sock");
+                            "--kconsumerd-err-sock");
                } else {
-                       config_string_set(
-                                       &the_config.kconsumerd_err_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.kconsumerd_err_unix_sock_path, strdup(arg));
                        if (!the_config.kconsumerd_err_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -470,11 +463,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--kconsumerd-cmd-sock");
+                            "--kconsumerd-cmd-sock");
                } else {
-                       config_string_set(
-                                       &the_config.kconsumerd_cmd_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.kconsumerd_cmd_unix_sock_path, strdup(arg));
                        if (!the_config.kconsumerd_cmd_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -487,11 +478,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--ustconsumerd64-err-sock");
+                            "--ustconsumerd64-err-sock");
                } else {
-                       config_string_set(
-                                       &the_config.consumerd64_err_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd64_err_unix_sock_path, strdup(arg));
                        if (!the_config.consumerd64_err_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -504,11 +493,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--ustconsumerd64-cmd-sock");
+                            "--ustconsumerd64-cmd-sock");
                } else {
-                       config_string_set(
-                                       &the_config.consumerd64_cmd_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd64_cmd_unix_sock_path, strdup(arg));
                        if (!the_config.consumerd64_cmd_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -521,11 +508,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--ustconsumerd32-err-sock");
+                            "--ustconsumerd32-err-sock");
                } else {
-                       config_string_set(
-                                       &the_config.consumerd32_err_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd32_err_unix_sock_path, strdup(arg));
                        if (!the_config.consumerd32_err_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -538,11 +523,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--ustconsumerd32-cmd-sock");
+                            "--ustconsumerd32-cmd-sock");
                } else {
-                       config_string_set(
-                                       &the_config.consumerd32_cmd_unix_sock_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd32_cmd_unix_sock_path, strdup(arg));
                        if (!the_config.consumerd32_cmd_unix_sock_path.value) {
                                ret = -ENOMEM;
                                PERROR("strdup");
@@ -563,9 +546,8 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                /* Clamp value to [0, 3] */
                the_config.verbose = the_config.verbose < 0 ?
-                                     0 :
-                                     (the_config.verbose <= 3 ? the_config.verbose :
-                                                                3);
+                       0 :
+                       (the_config.verbose <= 3 ? the_config.verbose : 3);
        } else if (string_match(optname, "verbose-consumer")) {
                if (arg) {
                        the_config.verbose_consumer = config_parse_value(arg);
@@ -579,10 +561,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--consumerd32-path");
+                            "--consumerd32-path");
                } else {
-                       config_string_set(&the_config.consumerd32_bin_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd32_bin_path, strdup(arg));
                        if (!the_config.consumerd32_bin_path.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -595,10 +576,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--consumerd32-libdir");
+                            "--consumerd32-libdir");
                } else {
-                       config_string_set(&the_config.consumerd32_lib_dir,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd32_lib_dir, strdup(arg));
                        if (!the_config.consumerd32_lib_dir.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -611,10 +591,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--consumerd64-path");
+                            "--consumerd64-path");
                } else {
-                       config_string_set(&the_config.consumerd64_bin_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd64_bin_path, strdup(arg));
                        if (!the_config.consumerd64_bin_path.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -627,10 +606,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--consumerd64-libdir");
+                            "--consumerd64-libdir");
                } else {
-                       config_string_set(&the_config.consumerd64_lib_dir,
-                                       strdup(arg));
+                       config_string_set(&the_config.consumerd64_lib_dir, strdup(arg));
                        if (!the_config.consumerd64_lib_dir.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -643,10 +621,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "-p, --pidfile");
+                            "-p, --pidfile");
                } else {
-                       config_string_set(
-                                       &the_config.pid_file_path, strdup(arg));
+                       config_string_set(&the_config.pid_file_path, strdup(arg));
                        if (!the_config.pid_file_path.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -659,12 +636,12 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--agent-tcp-port");
+                            "--agent-tcp-port");
                } else {
                        unsigned long v;
 
                        errno = 0;
-                       v = strtoul(arg, NULL, 0);
+                       v = strtoul(arg, nullptr, 0);
                        if (errno != 0 || !isdigit(arg[0])) {
                                ERR("Wrong value in --agent-tcp-port parameter: %s", arg);
                                return -1;
@@ -673,8 +650,7 @@ static int set_option(int opt, const char *arg, const char *optname)
                                ERR("Port overflow in --agent-tcp-port parameter: %s", arg);
                                return -1;
                        }
-                       the_config.agent_tcp_port.begin =
-                                       the_config.agent_tcp_port.end = (int) v;
+                       the_config.agent_tcp_port.begin = the_config.agent_tcp_port.end = (int) v;
                        DBG3("Agent TCP port set to non default: %i", (int) v);
                }
        } else if (string_match(optname, "load") || opt == 'l') {
@@ -684,10 +660,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "-l, --load");
+                            "-l, --load");
                } else {
-                       config_string_set(&the_config.load_session_path,
-                                       strdup(arg));
+                       config_string_set(&the_config.load_session_path, strdup(arg));
                        if (!the_config.load_session_path.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -700,10 +675,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--kmod-probes");
+                            "--kmod-probes");
                } else {
-                       config_string_set(&the_config.kmod_probes_list,
-                                       strdup(arg));
+                       config_string_set(&the_config.kmod_probes_list, strdup(arg));
                        if (!the_config.kmod_probes_list.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -716,10 +690,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                }
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "--extra-kmod-probes");
+                            "--extra-kmod-probes");
                } else {
-                       config_string_set(&the_config.kmod_extra_probes_list,
-                                       strdup(arg));
+                       config_string_set(&the_config.kmod_extra_probes_list, strdup(arg));
                        if (!the_config.kmod_extra_probes_list.value) {
                                PERROR("strdup");
                                ret = -ENOMEM;
@@ -729,39 +702,43 @@ static int set_option(int opt, const char *arg, const char *optname)
                unsigned long v;
 
                errno = 0;
-               v = strtoul(arg, NULL, 0);
+               v = strtoul(arg, nullptr, 0);
                if (errno != 0 || !isdigit(arg[0])) {
                        ERR("Wrong value in --%s parameter: %s",
-                                       EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR, arg);
+                           EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR,
+                           arg);
                        return -1;
                }
                if (v == 0 || v >= EVENT_NOTIFIER_ERROR_COUNTER_NUMBER_OF_BUCKET_MAX) {
                        ERR("Value out of range for --%s parameter: %s",
-                                       EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR, arg);
+                           EVENT_NOTIFIER_ERROR_BUFFER_SIZE_KERNEL_OPTION_STR,
+                           arg);
                        return -1;
                }
                the_config.event_notifier_buffer_size_kernel = (int) v;
                DBG3("Number of event notifier error buffer kernel size to non default: %i",
-                               the_config.event_notifier_buffer_size_kernel);
+                    the_config.event_notifier_buffer_size_kernel);
                goto end;
        } else if (string_match(optname, EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR)) {
                unsigned long v;
 
                errno = 0;
-               v = strtoul(arg, NULL, 0);
+               v = strtoul(arg, nullptr, 0);
                if (errno != 0 || !isdigit(arg[0])) {
                        ERR("Wrong value in --%s parameter: %s",
-                                       EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR, arg);
+                           EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR,
+                           arg);
                        return -1;
                }
                if (v == 0 || v >= EVENT_NOTIFIER_ERROR_COUNTER_NUMBER_OF_BUCKET_MAX) {
                        ERR("Value out of range for --%s parameter: %s",
-                                       EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR, arg);
+                           EVENT_NOTIFIER_ERROR_BUFFER_SIZE_USERSPACE_OPTION_STR,
+                           arg);
                        return -1;
                }
                the_config.event_notifier_buffer_size_userspace = (int) v;
                DBG3("Number of event notifier error buffer userspace size to non default: %i",
-                               the_config.event_notifier_buffer_size_userspace);
+                    the_config.event_notifier_buffer_size_userspace);
                goto end;
        } else if (string_match(optname, "config") || opt == 'f') {
                /* This is handled in set_options() thus silent skip. */
@@ -777,16 +754,14 @@ end:
                const char *opt_name = "unknown";
                int i;
 
-               for (i = 0; i < sizeof(long_options) / sizeof(struct option);
-                       i++) {
+               for (i = 0; i < sizeof(long_options) / sizeof(struct option); i++) {
                        if (opt == long_options[i].val) {
                                opt_name = long_options[i].name;
                                break;
                        }
                }
 
-               WARN("Invalid argument provided for option \"%s\", using default value.",
-                       opt_name);
+               WARN("Invalid argument provided for option \"%s\", using default value.", opt_name);
        }
 
        return ret;
@@ -798,7 +773,7 @@ end:
  * return value conventions.
  */
 static int config_entry_handler(const struct config_entry *entry,
-               void *unused __attribute__((unused)))
+                               void *unused __attribute__((unused)))
 {
        int ret = 0, i;
 
@@ -814,11 +789,9 @@ static int config_entry_handler(const struct config_entry *entry,
                }
        }
 
-       for (i = 0; i < (sizeof(long_options) / sizeof(struct option)) - 1;
-               i++) {
-
+       for (i = 0; i < (sizeof(long_options) / sizeof(struct option)) - 1; i++) {
                /* Ignore if not fully matched. */
-               if (strcmp(entry->name, long_options[i].name)) {
+               if (strcmp(entry->name, long_options[i].name) != 0) {
                        continue;
                }
 
@@ -832,7 +805,8 @@ static int config_entry_handler(const struct config_entry *entry,
                        if (ret <= 0) {
                                if (ret) {
                                        WARN("Invalid configuration value \"%s\" for option %s",
-                                                       entry->value, entry->name);
+                                            entry->value,
+                                            entry->name);
                                }
                                /* False, skip boolean config option. */
                                goto end;
@@ -849,7 +823,8 @@ end:
        return ret;
 }
 
-static void print_version(void) {
+static void print_version()
+{
        fprintf(stdout, "%s\n", VERSION);
 }
 
@@ -861,18 +836,17 @@ static int set_options(int argc, char **argv)
        int ret = 0, c = 0, option_index = 0;
        int orig_optopt = optopt, orig_optind = optind;
        char *optstring;
-       char *config_path = NULL;
+       char *config_path = nullptr;
 
        optstring = utils_generate_optstring(long_options,
-                       sizeof(long_options) / sizeof(struct option));
+                                            sizeof(long_options) / sizeof(struct option));
        if (!optstring) {
                ret = -ENOMEM;
                goto end;
        }
 
        /* Check for the --config option */
-       while ((c = getopt_long(argc, argv, optstring, long_options,
-                                       &option_index)) != -1) {
+       while ((c = getopt_long(argc, argv, optstring, long_options, &option_index)) != -1) {
                if (c == '?') {
                        ret = -EINVAL;
                        goto end;
@@ -883,7 +857,7 @@ static int set_options(int argc, char **argv)
 
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-                               "-f, --config");
+                            "-f, --config");
                } else {
                        free(config_path);
                        config_path = utils_expand_path(optarg);
@@ -893,8 +867,8 @@ static int set_options(int argc, char **argv)
                }
        }
 
-       ret = config_get_section_entries(config_path, config_section_name,
-                       config_entry_handler, NULL);
+       ret = config_get_section_entries(
+               config_path, config_section_name, config_entry_handler, nullptr);
        if (ret) {
                if (ret > 0) {
                        ERR("Invalid configuration option at line %i", ret);
@@ -906,14 +880,13 @@ static int set_options(int argc, char **argv)
        /* Reset getopt's global state */
        optopt = orig_optopt;
        optind = orig_optind;
-       while (1) {
+       while (true) {
                option_index = -1;
                /*
                 * getopt_long() will not set option_index if it encounters a
                 * short option.
                 */
-               c = getopt_long(argc, argv, optstring, long_options,
-                               &option_index);
+               c = getopt_long(argc, argv, optstring, long_options, &option_index);
                if (c == -1) {
                        break;
                }
@@ -922,9 +895,8 @@ static int set_options(int argc, char **argv)
                 * Pass NULL as the long option name if popt left the index
                 * unset.
                 */
-               ret = set_option(c, optarg,
-                               option_index < 0 ? NULL :
-                               long_options[option_index].name);
+               ret = set_option(
+                       c, optarg, option_index < 0 ? nullptr : long_options[option_index].name);
                if (ret < 0) {
                        break;
                }
@@ -939,7 +911,7 @@ end:
 /*
  * Create lockfile using the rundir and return its fd.
  */
-static int create_lockfile(void)
+static int create_lockfile()
 {
        return utils_create_lock_file(the_config.lock_file_path.value);
 }
@@ -950,7 +922,7 @@ static int create_lockfile(void)
  *
  * Also attempts to create and hold the lock file.
  */
-static int check_existing_daemon(void)
+static int check_existing_daemon()
 {
        int ret = 0;
 
@@ -969,7 +941,7 @@ end:
        return ret;
 }
 
-static void sessiond_cleanup_lock_file(void)
+static void sessiond_cleanup_lock_file()
 {
        int ret;
 
@@ -1000,8 +972,7 @@ static int set_permissions(char *rundir)
        int ret;
        gid_t gid;
 
-       ret = utils_get_group_id(
-                       the_config.tracing_group_name.value, true, &gid);
+       ret = utils_get_group_id(the_config.tracing_group_name.value, true, &gid);
        if (ret) {
                /* Default to root group. */
                gid = 0;
@@ -1028,32 +999,28 @@ static int set_permissions(char *rundir)
        /* lttng client socket path */
        ret = chown(the_config.client_unix_sock_path.value, 0, gid);
        if (ret < 0) {
-               ERR("Unable to set group on %s",
-                               the_config.client_unix_sock_path.value);
+               ERR("Unable to set group on %s", the_config.client_unix_sock_path.value);
                PERROR("chown");
        }
 
        /* kconsumer error socket path */
        ret = chown(the_kconsumer_data.err_unix_sock_path, 0, 0);
        if (ret < 0) {
-               ERR("Unable to set group on %s",
-                               the_kconsumer_data.err_unix_sock_path);
+               ERR("Unable to set group on %s", the_kconsumer_data.err_unix_sock_path);
                PERROR("chown");
        }
 
        /* 64-bit ustconsumer error socket path */
        ret = chown(the_ustconsumer64_data.err_unix_sock_path, 0, 0);
        if (ret < 0) {
-               ERR("Unable to set group on %s",
-                               the_ustconsumer64_data.err_unix_sock_path);
+               ERR("Unable to set group on %s", the_ustconsumer64_data.err_unix_sock_path);
                PERROR("chown");
        }
 
        /* 32-bit ustconsumer compat32 error socket path */
        ret = chown(the_ustconsumer32_data.err_unix_sock_path, 0, 0);
        if (ret < 0) {
-               ERR("Unable to set group on %s",
-                               the_ustconsumer32_data.err_unix_sock_path);
+               ERR("Unable to set group on %s", the_ustconsumer32_data.err_unix_sock_path);
                PERROR("chown");
        }
 
@@ -1065,7 +1032,7 @@ static int set_permissions(char *rundir)
 /*
  * Create the lttng run directory needed for all global sockets and pipe.
  */
-static int create_lttng_rundir(void)
+static int create_lttng_rundir()
 {
        int ret;
 
@@ -1092,7 +1059,7 @@ error:
 static int set_consumer_sockets(struct consumer_data *consumer_data)
 {
        int ret;
-       char *path = NULL;
+       char *path = nullptr;
 
        switch (consumer_data->type) {
        case LTTNG_CONSUMER_KERNEL:
@@ -1122,8 +1089,7 @@ static int set_consumer_sockets(struct consumer_data *consumer_data)
        if (is_root) {
                gid_t gid;
 
-               ret = utils_get_group_id(the_config.tracing_group_name.value,
-                               true, &gid);
+               ret = utils_get_group_id(the_config.tracing_group_name.value, true, &gid);
                if (ret) {
                        /* Default to root group. */
                        gid = 0;
@@ -1138,8 +1104,7 @@ static int set_consumer_sockets(struct consumer_data *consumer_data)
        }
 
        /* Create the consumerd error unix socket */
-       consumer_data->err_sock =
-               lttcomm_create_unix_sock(consumer_data->err_unix_sock_path);
+       consumer_data->err_sock = lttcomm_create_unix_sock(consumer_data->err_unix_sock_path);
        if (consumer_data->err_sock < 0) {
                ERR("Create unix sock failed: %s", consumer_data->err_unix_sock_path);
                ret = -1;
@@ -1157,8 +1122,7 @@ static int set_consumer_sockets(struct consumer_data *consumer_data)
        }
 
        /* File permission MUST be 660 */
-       ret = chmod(consumer_data->err_unix_sock_path,
-                       S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+       ret = chmod(consumer_data->err_unix_sock_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
        if (ret < 0) {
                ERR("Set file permissions failed: %s", consumer_data->err_unix_sock_path);
                PERROR("chmod");
@@ -1175,8 +1139,7 @@ error:
  * Simply stop all worker threads, leaving main() return gracefully after
  * joining all threads and calling cleanup().
  */
-static void sighandler(int sig, siginfo_t *siginfo,
-               void *arg __attribute__((unused)))
+static void sighandler(int sig, siginfo_t *siginfo, void *arg __attribute__((unused)))
 {
        switch (sig) {
        case SIGINT:
@@ -1216,7 +1179,7 @@ static void sighandler(int sig, siginfo_t *siginfo,
  * Setup signal handler for :
  *             SIGINT, SIGTERM, SIGPIPE
  */
-static int set_signal_handler(void)
+static int set_signal_handler()
 {
        int ret = 0;
        struct sigaction sa;
@@ -1231,29 +1194,29 @@ static int set_signal_handler(void)
        sa.sa_flags = SA_SIGINFO;
 
        sa.sa_sigaction = sighandler;
-       if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
+       if ((ret = sigaction(SIGTERM, &sa, nullptr)) < 0) {
                PERROR("sigaction");
                return ret;
        }
 
-       if ((ret = sigaction(SIGINT, &sa, NULL)) < 0) {
+       if ((ret = sigaction(SIGINT, &sa, nullptr)) < 0) {
                PERROR("sigaction");
                return ret;
        }
 
-       if ((ret = sigaction(SIGUSR1, &sa, NULL)) < 0) {
+       if ((ret = sigaction(SIGUSR1, &sa, nullptr)) < 0) {
                PERROR("sigaction");
                return ret;
        }
 
-       if ((ret = sigaction(SIGBUS, &sa, NULL)) < 0) {
+       if ((ret = sigaction(SIGBUS, &sa, nullptr)) < 0) {
                PERROR("sigaction");
                return ret;
        }
 
        sa.sa_flags = 0;
        sa.sa_handler = SIG_IGN;
-       if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
+       if ((ret = sigaction(SIGPIPE, &sa, nullptr)) < 0) {
                PERROR("sigaction");
                return ret;
        }
@@ -1267,7 +1230,7 @@ static int set_signal_handler(void)
  * Set open files limit to unlimited. This daemon can open a large number of
  * file descriptors in order to consume multiple kernel traces.
  */
-static void set_ulimit(void)
+static void set_ulimit()
 {
        int ret;
        struct rlimit lim;
@@ -1282,22 +1245,22 @@ static void set_ulimit(void)
        }
 }
 
-static int write_pidfile(void)
+static int write_pidfile()
 {
        return utils_create_pid_file(getpid(), the_config.pid_file_path.value);
 }
 
-static int set_clock_plugin_env(void)
+static int set_clock_plugin_env()
 {
        int ret = 0;
-       char *env_value = NULL;
+       char *env_value = nullptr;
 
        if (!the_config.lttng_ust_clock_plugin.value) {
                goto end;
        }
 
-       ret = asprintf(&env_value, "LTTNG_UST_CLOCK_PLUGIN=%s",
-                       the_config.lttng_ust_clock_plugin.value);
+       ret = asprintf(
+               &env_value, "LTTNG_UST_CLOCK_PLUGIN=%s", the_config.lttng_ust_clock_plugin.value);
        if (ret < 0) {
                PERROR("asprintf");
                goto end;
@@ -1311,12 +1274,12 @@ static int set_clock_plugin_env(void)
        }
 
        DBG("Updated LTTNG_UST_CLOCK_PLUGIN environment variable to \"%s\"",
-                       the_config.lttng_ust_clock_plugin.value);
+           the_config.lttng_ust_clock_plugin.value);
 end:
        return ret;
 }
 
-static void destroy_all_sessions_and_wait(void)
+static void destroy_all_sessions_and_wait()
 {
        struct ltt_session *session, *tmp;
        struct ltt_session_list *session_list;
@@ -1330,8 +1293,7 @@ static void destroy_all_sessions_and_wait(void)
 
        session_lock_list();
        /* Initiate the destruction of all sessions. */
-       cds_list_for_each_entry_safe(session, tmp,
-                       &session_list->head, list) {
+       cds_list_for_each_entry_safe (session, tmp, &session_list->head, list) {
                if (!session_get(session)) {
                        continue;
                }
@@ -1341,8 +1303,7 @@ static void destroy_all_sessions_and_wait(void)
                        goto unlock_session;
                }
                (void) cmd_stop_trace(session);
-               (void) cmd_destroy_session(
-                               session, the_notification_thread_handle, NULL);
+               (void) cmd_destroy_session(session, the_notification_thread_handle, nullptr);
        unlock_session:
                session_unlock(session);
                session_put(session);
@@ -1355,11 +1316,11 @@ static void destroy_all_sessions_and_wait(void)
        DBG("Destruction of all sessions completed");
 }
 
-static void unregister_all_triggers(void)
+static void unregister_all_triggers()
 {
        enum lttng_error_code ret_code;
        enum lttng_trigger_status trigger_status;
-       struct lttng_triggers *triggers = NULL;
+       struct lttng_triggers *triggers = nullptr;
        unsigned int trigger_count, i;
        const struct lttng_credentials creds = {
                .uid = LTTNG_OPTIONAL_INIT_VALUE(0),
@@ -1372,8 +1333,7 @@ static void unregister_all_triggers(void)
         * List all triggers as "root" since we wish to unregister all triggers.
         */
        ret_code = notification_thread_command_list_triggers(
-                       the_notification_thread_handle, creds.uid.value,
-                       &triggers);
+               the_notification_thread_handle, creds.uid.value, &triggers);
        if (ret_code != LTTNG_OK) {
                ERR("Failed to list triggers while unregistering all triggers");
                goto end;
@@ -1385,28 +1345,27 @@ static void unregister_all_triggers(void)
        for (i = 0; i < trigger_count; i++) {
                uid_t trigger_owner;
                const char *trigger_name;
-               const struct lttng_trigger *trigger =
-                               lttng_triggers_get_at_index(triggers, i);
+               const struct lttng_trigger *trigger = lttng_triggers_get_at_index(triggers, i);
 
                LTTNG_ASSERT(trigger);
 
-               trigger_status = lttng_trigger_get_owner_uid(
-                               trigger, &trigger_owner);
+               trigger_status = lttng_trigger_get_owner_uid(trigger, &trigger_owner);
                LTTNG_ASSERT(trigger_status == LTTNG_TRIGGER_STATUS_OK);
 
                trigger_status = lttng_trigger_get_name(trigger, &trigger_name);
-               trigger_name = trigger_status == LTTNG_TRIGGER_STATUS_OK ?
-                               trigger_name : "(anonymous)";
+               trigger_name = trigger_status == LTTNG_TRIGGER_STATUS_OK ? trigger_name :
+                                                                          "(anonymous)";
 
                DBG("Unregistering trigger: trigger owner uid = %d, trigger name = '%s'",
-                               (int) trigger_owner, trigger_name);
+                   (int) trigger_owner,
+                   trigger_name);
 
-               ret_code = cmd_unregister_trigger(&creds, trigger,
-                               the_notification_thread_handle);
+               ret_code = cmd_unregister_trigger(&creds, trigger, the_notification_thread_handle);
                if (ret_code != LTTNG_OK) {
                        ERR("Failed to unregister trigger: trigger owner uid = %d, trigger name = '%s', error: '%s'",
-                                       (int) trigger_owner, trigger_name,
-                                       lttng_strerror(-ret_code));
+                           (int) trigger_owner,
+                           trigger_name,
+                           lttng_strerror(-ret_code));
                        /* Continue to unregister the remaining triggers. */
                }
        }
@@ -1430,11 +1389,10 @@ static int launch_run_as_worker(const char *procname)
         * be leaked as the process forks a run-as worker (and performs
         * no exec*()). The same would apply to any opened fd.
         */
-       return run_as_create_worker(
-                       procname, run_as_worker_post_fork_cleanup, &the_config);
+       return run_as_create_worker(procname, run_as_worker_post_fork_cleanup, &the_config);
 }
 
-static void sessiond_uuid_log(void)
+static void sessiond_uuid_log()
 {
        char uuid_str[LTTNG_UUID_STR_LEN];
 
@@ -1449,17 +1407,17 @@ int main(int argc, char **argv)
 {
        int ret = 0, retval = 0;
        const char *env_app_timeout;
-       struct lttng_pipe *ust32_channel_monitor_pipe = NULL,
-                       *ust64_channel_monitor_pipe = NULL,
-                       *kernel_channel_monitor_pipe = NULL;
+       struct lttng_pipe *ust32_channel_monitor_pipe = nullptr,
+                         *ust64_channel_monitor_pipe = nullptr,
+                         *kernel_channel_monitor_pipe = nullptr;
        struct timer_thread_parameters timer_thread_parameters;
        /* Rotation thread handle. */
-       struct rotation_thread_handle *rotation_thread_handle = NULL;
+       struct rotation_thread_handle *rotation_thread_handle = nullptr;
        /* Queue of rotation jobs populated by the sessiond-timer. */
-       struct rotation_thread_timer_queue *rotation_timer_queue = NULL;
-       struct lttng_thread *client_thread = NULL;
-       struct lttng_thread *notification_thread = NULL;
-       struct lttng_thread *register_apps_thread = NULL;
+       struct rotation_thread_timer_queue *rotation_timer_queue = nullptr;
+       struct lttng_thread *client_thread = nullptr;
+       struct lttng_thread *notification_thread = nullptr;
+       struct lttng_thread *register_apps_thread = nullptr;
        enum event_notifier_error_accounting_status event_notifier_error_accounting_status;
 
        logger_set_thread_name("Main", false);
@@ -1522,22 +1480,17 @@ int main(int argc, char **argv)
        /* Apply config. */
        lttng_opt_verbose = the_config.verbose;
        lttng_opt_quiet = the_config.quiet;
-       the_kconsumer_data.err_unix_sock_path =
-                       the_config.kconsumerd_err_unix_sock_path.value;
-       the_kconsumer_data.cmd_unix_sock_path =
-                       the_config.kconsumerd_cmd_unix_sock_path.value;
-       the_ustconsumer32_data.err_unix_sock_path =
-                       the_config.consumerd32_err_unix_sock_path.value;
-       the_ustconsumer32_data.cmd_unix_sock_path =
-                       the_config.consumerd32_cmd_unix_sock_path.value;
-       the_ustconsumer64_data.err_unix_sock_path =
-                       the_config.consumerd64_err_unix_sock_path.value;
-       the_ustconsumer64_data.cmd_unix_sock_path =
-                       the_config.consumerd64_cmd_unix_sock_path.value;
+       the_kconsumer_data.err_unix_sock_path = the_config.kconsumerd_err_unix_sock_path.value;
+       the_kconsumer_data.cmd_unix_sock_path = the_config.kconsumerd_cmd_unix_sock_path.value;
+       the_ustconsumer32_data.err_unix_sock_path = the_config.consumerd32_err_unix_sock_path.value;
+       the_ustconsumer32_data.cmd_unix_sock_path = the_config.consumerd32_cmd_unix_sock_path.value;
+       the_ustconsumer64_data.err_unix_sock_path = the_config.consumerd64_err_unix_sock_path.value;
+       the_ustconsumer64_data.cmd_unix_sock_path = the_config.consumerd64_cmd_unix_sock_path.value;
        set_clock_plugin_env();
 
        sessiond_config_log(&the_config);
        sessiond_uuid_log();
+       lttng::logging::log_system_information(PRINT_DBG);
 
        if (opt_print_version) {
                print_version();
@@ -1561,8 +1514,7 @@ int main(int argc, char **argv)
        if (the_config.daemonize || the_config.background) {
                int i;
 
-               ret = lttng_daemonize(&the_child_ppid, &recv_child_signal,
-                               !the_config.background);
+               ret = lttng_daemonize(&the_child_ppid, &recv_child_signal, !the_config.background);
                if (ret < 0) {
                        retval = -1;
                        goto exit_options;
@@ -1619,8 +1571,7 @@ int main(int argc, char **argv)
                        goto stop_threads;
                }
                the_kconsumer_data.channel_monitor_pipe =
-                               lttng_pipe_release_writefd(
-                                               kernel_channel_monitor_pipe);
+                       lttng_pipe_release_writefd(kernel_channel_monitor_pipe);
                if (the_kconsumer_data.channel_monitor_pipe < 0) {
                        retval = -1;
                        goto stop_threads;
@@ -1638,7 +1589,7 @@ int main(int argc, char **argv)
                goto stop_threads;
        }
        the_ustconsumer32_data.channel_monitor_pipe =
-                       lttng_pipe_release_writefd(ust32_channel_monitor_pipe);
+               lttng_pipe_release_writefd(ust32_channel_monitor_pipe);
        if (the_ustconsumer32_data.channel_monitor_pipe < 0) {
                retval = -1;
                goto stop_threads;
@@ -1654,8 +1605,7 @@ int main(int argc, char **argv)
                retval = -1;
                goto stop_threads;
        }
-       timer_thread_parameters.rotation_thread_job_queue =
-                       rotation_timer_queue;
+       timer_thread_parameters.rotation_thread_job_queue = rotation_timer_queue;
 
        ust64_channel_monitor_pipe = lttng_pipe_open(0);
        if (!ust64_channel_monitor_pipe) {
@@ -1664,7 +1614,7 @@ int main(int argc, char **argv)
                goto stop_threads;
        }
        the_ustconsumer64_data.channel_monitor_pipe =
-                       lttng_pipe_release_writefd(ust64_channel_monitor_pipe);
+               lttng_pipe_release_writefd(ust64_channel_monitor_pipe);
        if (the_ustconsumer64_data.channel_monitor_pipe < 0) {
                retval = -1;
                goto stop_threads;
@@ -1681,8 +1631,8 @@ int main(int argc, char **argv)
        }
 
        event_notifier_error_accounting_status = event_notifier_error_accounting_init(
-                       the_config.event_notifier_buffer_size_kernel,
-                       the_config.event_notifier_buffer_size_userspace);
+               the_config.event_notifier_buffer_size_kernel,
+               the_config.event_notifier_buffer_size_userspace);
        if (event_notifier_error_accounting_status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) {
                ERR("Failed to initialize event notifier error accounting system");
                retval = -1;
@@ -1798,9 +1748,10 @@ int main(int argc, char **argv)
        }
 
        /* notification_thread_data acquires the pipes' read side. */
-       the_notification_thread_handle = notification_thread_handle_create(
-                       ust32_channel_monitor_pipe, ust64_channel_monitor_pipe,
-                       kernel_channel_monitor_pipe);
+       the_notification_thread_handle =
+               notification_thread_handle_create(ust32_channel_monitor_pipe,
+                                                 ust64_channel_monitor_pipe,
+                                                 kernel_channel_monitor_pipe);
        if (!the_notification_thread_handle) {
                retval = -1;
                ERR("Failed to create notification thread shared data");
@@ -1808,8 +1759,7 @@ int main(int argc, char **argv)
        }
 
        /* Create notification thread. */
-       notification_thread = launch_notification_thread(
-                       the_notification_thread_handle);
+       notification_thread = launch_notification_thread(the_notification_thread_handle);
        if (!notification_thread) {
                retval = -1;
                goto stop_threads;
@@ -1822,8 +1772,8 @@ int main(int argc, char **argv)
        }
 
        /* rotation_thread_data acquires the pipes' read side. */
-       rotation_thread_handle = rotation_thread_handle_create(
-                       rotation_timer_queue, the_notification_thread_handle);
+       rotation_thread_handle =
+               rotation_thread_handle_create(rotation_timer_queue, the_notification_thread_handle);
        if (!rotation_thread_handle) {
                retval = -1;
                ERR("Failed to create rotation thread shared data");
@@ -1849,15 +1799,13 @@ int main(int argc, char **argv)
                goto stop_threads;
        }
 
-       if (!launch_ust_dispatch_thread(&ust_cmd_queue, apps_cmd_pipe[1],
-                       apps_cmd_notify_pipe[1])) {
+       if (!launch_ust_dispatch_thread(&ust_cmd_queue, apps_cmd_pipe[1], apps_cmd_notify_pipe[1])) {
                retval = -1;
                goto stop_threads;
        }
 
        /* Create thread to manage application registration. */
-       register_apps_thread = launch_application_registration_thread(
-                       &ust_cmd_queue);
+       register_apps_thread = launch_application_registration_thread(&ust_cmd_queue);
        if (!register_apps_thread) {
                retval = -1;
                goto stop_threads;
@@ -1891,9 +1839,9 @@ int main(int argc, char **argv)
 
                if (kernel_get_notification_fd() >= 0) {
                        ret = notification_thread_command_add_tracer_event_source(
-                                       the_notification_thread_handle,
-                                       kernel_get_notification_fd(),
-                                       LTTNG_DOMAIN_KERNEL);
+                               the_notification_thread_handle,
+                               kernel_get_notification_fd(),
+                               LTTNG_DOMAIN_KERNEL);
                        if (ret != LTTNG_OK) {
                                ERR("Failed to add kernel trigger event source to notification thread");
                                retval = -1;
@@ -1903,8 +1851,7 @@ int main(int argc, char **argv)
        }
 
        /* Load sessions. */
-       ret = config_load_session(
-                       the_config.load_session_path.value, NULL, 1, 1, NULL);
+       ret = config_load_session(the_config.load_session_path.value, nullptr, 1, 1, nullptr);
        if (ret) {
                ERR("Session load failed: %s", error_get_str(ret));
                retval = -1;
@@ -1990,7 +1937,7 @@ stop_threads:
         */
        if (is_root && !the_config.no_kernel) {
                DBG("Unloading kernel modules");
-               modprobe_remove_lttng_all();
+               modprobe_remove_lttng_all();
        }
 
        rcu_thread_offline();
@@ -2011,8 +1958,7 @@ stop_threads:
         * of the active session and channels at the moment of the teardown.
         */
        if (the_notification_thread_handle) {
-               notification_thread_handle_destroy(
-                               the_notification_thread_handle);
+               notification_thread_handle_destroy(the_notification_thread_handle);
        }
        lttng_pipe_destroy(ust32_channel_monitor_pipe);
        lttng_pipe_destroy(ust64_channel_monitor_pipe);
This page took 0.041735 seconds and 4 git commands to generate.