]> git.lttng.org Git - lttng-tools.git/commitdiff
Clean-up: clang-format fixes
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 16 Jan 2025 17:24:43 +0000 (17:24 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 16 Jan 2025 17:25:55 +0000 (17:25 +0000)
Change-Id: Ie5d2d6072290aaaedfe5990eed4f7c9baff02561
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/health-relayd.cpp
src/bin/lttng-relayd/live.cpp
src/bin/lttng-relayd/main.cpp
src/bin/lttng-relayd/utils.hpp
src/bin/lttng/commands/enable_channels.cpp
src/common/defaults.hpp
src/common/utils.cpp

index 9f131029e9eae0de296f606b109691df08791f44..1c357d50c17331576e64d59887b67614c99faaf5 100644 (file)
@@ -65,7 +65,6 @@ int send_unix_sock(int sock, void *buf, size_t len)
        return lttcomm_send_unix_sock(sock, buf, len);
 }
 
-
 void parse_health_env()
 {
        const char *health_path;
index 4c703421cc8aef24017cc415e7968c6e438f8ea0..1fb4a25a664ae4b7185d13a04102b9fa9b86c8e5 100644 (file)
@@ -880,7 +880,7 @@ static void *thread_listener(void *data __attribute__((unused)))
        health_code_update();
        try {
                live_control_sock = init_socket(live_uri, "Live listener");
-       } catch(const lttng::runtime_error& ex) {
+       } catch (const lttng::runtime_error& ex) {
                ERR("Failed to initialize live socket: %s", ex.what());
                goto error_sock_control;
        }
index e4c12153868f102787024bdc4c4006ee51c27bbf..68790451224be58f76f2f5521e9799a4ee3415fa 100644 (file)
@@ -214,12 +214,7 @@ static struct option long_options[] = {
                nullptr,
                'b',
        },
-       {
-               "pid-file",
-               1,
-               nullptr,
-               'P'
-       },
+       { "pid-file", 1, nullptr, 'P' },
        {
                "group",
                1,
@@ -272,12 +267,7 @@ static struct option long_options[] = {
        },
        { "disallow-clear", 0, nullptr, 'x' },
        { "dynamic-port-allocation", 0, nullptr, '\0' },
-       {
-               "sig-parent",
-               0,
-               nullptr,
-               'S'
-       },
+       { "sig-parent", 0, nullptr, 'S' },
        {
                nullptr,
                0,
@@ -1071,7 +1061,10 @@ static struct lttcomm_sock *relay_socket_create(struct lttng_uri *uri, const cha
                goto error;
        }
 
-       DBG("Bound %s socket fd %d to port %d", name, sock->fd, ntohs(sock->sockaddr.addr.sin.sin_port));
+       DBG("Bound %s socket fd %d to port %d",
+           name,
+           sock->fd,
+           ntohs(sock->sockaddr.addr.sin.sin_port));
        ret = sock->ops->listen(sock, -1);
        if (ret < 0) {
                goto error;
@@ -1145,13 +1138,19 @@ static void *relay_thread_listener(void *data __attribute__((unused)))
 
        create_lttng_rundir_with_perm(rundir_path.get());
        create_lttng_rundir_with_perm(relayd_rundir_path.get());
-       ret = snprintf(relayd_control_port_path, sizeof(relayd_control_port_path), DEFAULT_RELAYD_CONTROL_PORT_PATH, relayd_rundir_path.get());
+       ret = snprintf(relayd_control_port_path,
+                      sizeof(relayd_control_port_path),
+                      DEFAULT_RELAYD_CONTROL_PORT_PATH,
+                      relayd_rundir_path.get());
        if (ret < 0) {
                ERR("Failed to format relayd_control_port_path");
                goto error_sock_control;
        }
 
-       ret = snprintf(relayd_data_port_path, sizeof(relayd_data_port_path), DEFAULT_RELAYD_DATA_PORT_PATH, relayd_rundir_path.get());
+       ret = snprintf(relayd_data_port_path,
+                      sizeof(relayd_data_port_path),
+                      DEFAULT_RELAYD_DATA_PORT_PATH,
+                      relayd_rundir_path.get());
        if (ret < 0) {
                ERR("Failed to format relayd_data_port_path");
                goto error_sock_control;
@@ -1165,8 +1164,11 @@ static void *relay_thread_listener(void *data __attribute__((unused)))
        }
 
        if (auto _ret = utils_create_value_file(ntohs(control_sock->sockaddr.addr.sin.sin_port),
-                                   relayd_control_port_path)) {
-               ERR_FMT("Failed to create control port path file: port={}, path=`{}`, ret={}", ntohs(control_sock->sockaddr.addr.sin.sin_port), relayd_control_port_path, _ret);
+                                               relayd_control_port_path)) {
+               ERR_FMT("Failed to create control port path file: port={}, path=`{}`, ret={}",
+                       ntohs(control_sock->sockaddr.addr.sin.sin_port),
+                       relayd_control_port_path,
+                       _ret);
                goto error_create_poll;
                goto error_sock_relay;
        }
@@ -1177,8 +1179,11 @@ static void *relay_thread_listener(void *data __attribute__((unused)))
        }
 
        if (auto _ret = utils_create_value_file(ntohs(data_sock->sockaddr.addr.sin.sin_port),
-                                 relayd_data_port_path)) {
-               ERR_FMT("Failed to create data port path file: port={}, path=`{}`, ret={}", ntohs(data_sock->sockaddr.addr.sin.sin_port), relayd_data_port_path, _ret);
+                                               relayd_data_port_path)) {
+               ERR_FMT("Failed to create data port path file: port={}, path=`{}`, ret={}",
+                       ntohs(data_sock->sockaddr.addr.sin.sin_port),
+                       relayd_data_port_path,
+                       _ret);
                goto error_create_poll;
        }
 
index c42ee82aecdc431654b9eb6dd191906f769567d4..c5ed07d480ef80031401c9c288531362b53bd471 100644 (file)
@@ -11,6 +11,6 @@
  */
 
 char *create_output_path(const char *path_name);
-void create_lttng_rundir_with_perm(const charrundir);
+void create_lttng_rundir_with_perm(const char *rundir);
 
 #endif /* RELAYD_UTILS_H */
index bbce3e4b62890e73339ec2df13a4bb5a7f502742..13553e68c48544de3b07ea1606ec9a6c28e22e28 100644 (file)
@@ -135,15 +135,20 @@ static void set_default_attr(struct lttng_domain *dom)
        }
 }
 
-static bool system_has_memory_for_channel_buffers(char *session_name, struct lttng_channel *channel, uint64_t *bytes_required, uint64_t *bytes_available) {
+static bool system_has_memory_for_channel_buffers(char *session_name,
+                                                 struct lttng_channel *channel,
+                                                 uint64_t *bytes_required,
+                                                 uint64_t *bytes_available)
+{
        /*
         * Verify that the amount of memory required to create the requested
         * buffer is available on the system at the moment.
         */
-       unsigned long total_buffer_size_needed_per_cpu {0};
-       const auto spec = lttng::cli::session_spec(lttng::cli::session_spec::type::NAME, session_name);
+       unsigned long total_buffer_size_needed_per_cpu{ 0 };
+       const auto spec =
+               lttng::cli::session_spec(lttng::cli::session_spec::type::NAME, session_name);
        const auto sessions = list_sessions(spec);
-       int ncpus {0};
+       int ncpus{ 0 };
 
        if (sessions.size() <= 0) {
                /* Session not found */
@@ -153,20 +158,24 @@ static bool system_has_memory_for_channel_buffers(char *session_name, struct ltt
 
        if (channel->attr.num_subbuf > UINT64_MAX / channel->attr.subbuf_size) {
                /* Overflow */
-               ERR_FMT("Integer overflow calculating total buffer size per CPU on channel '{}': num_subbuf={}, subbuf_size={}", channel->name, channel->attr.num_subbuf, channel->attr.subbuf_size)
+               ERR_FMT("Integer overflow calculating total buffer size per CPU on channel '{}': num_subbuf={}, subbuf_size={}",
+                       channel->name,
+                       channel->attr.num_subbuf,
+                       channel->attr.subbuf_size)
                return false;
        }
 
        total_buffer_size_needed_per_cpu = channel->attr.num_subbuf * channel->attr.subbuf_size;
        try {
                ncpus = utils_get_cpu_count();
-       } catch (const std::exception &ex) {
+       } catch (const std::exceptionex) {
                ERR_FMT("Exception when getting CPU count: {}", ex.what());
                return false;
        }
 
        /* In snapshot mode, an extra set of buffers is required. */
-       const auto _bytes_required = static_cast<uint64_t>(total_buffer_size_needed_per_cpu * ncpus + sessions[0].snapshot_mode);
+       const auto _bytes_required = static_cast<uint64_t>(
+               total_buffer_size_needed_per_cpu * ncpus + sessions[0].snapshot_mode);
        if (bytes_required != nullptr) {
                *bytes_required = _bytes_required;
        }
index 5c296a389e470bf6d5d15658c29db1620e5486cd..6e4ef94ea411c0f73b5cdd56d896a5a5c41c15bd 100644 (file)
 #define DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH DEFAULT_USTCONSUMERD32_PATH "/error"
 
 /* Relayd path */
-#define DEFAULT_RELAYD_RUNDIR "%s"
-#define DEFAULT_RELAYD_PATH   DEFAULT_RELAYD_RUNDIR "/relayd"
-#define DEFAULT_RELAYD_CONTROL_PORT_PATH  DEFAULT_LTTNG_EXPLICIT_RUNDIR "/control.port"
-#define DEFAULT_RELAYD_DATA_PORT_PATH DEFAULT_LTTNG_EXPLICIT_RUNDIR "/data.port"
-#define DEFAULT_RELAYD_LIVE_PORT_PATH DEFAULT_LTTNG_EXPLICIT_RUNDIR "/live.port"
+#define DEFAULT_RELAYD_RUNDIR           "%s"
+#define DEFAULT_RELAYD_PATH             DEFAULT_RELAYD_RUNDIR "/relayd"
+#define DEFAULT_RELAYD_CONTROL_PORT_PATH DEFAULT_LTTNG_EXPLICIT_RUNDIR "/control.port"
+#define DEFAULT_RELAYD_DATA_PORT_PATH   DEFAULT_LTTNG_EXPLICIT_RUNDIR "/data.port"
+#define DEFAULT_RELAYD_LIVE_PORT_PATH   DEFAULT_LTTNG_EXPLICIT_RUNDIR "/live.port"
 
 #define DEFAULT_RELAYD_MIN_FD_POOL_SIZE 100
 /*
  */
 #define DEFAULT_ROTATE_PENDING_TIMER CONFIG_DEFAULT_ROTATE_PENDING_TIMER
 
-#define DEFAULT_LINUX_POSSIBLE_CPU_PATH "/sys/devices/system/cpu/possible"
+#define DEFAULT_LINUX_POSSIBLE_CPU_PATH               "/sys/devices/system/cpu/possible"
 #define DEFAULT_LINUX_POSSIBLE_CPU_MASK_LENGTH 4096
 
 /*
index 78d7beb5a49f62419de9a3ec8b557563e2b8a9cb..2888404454ee5e960931aeff53cb6b636958459c 100644 (file)
@@ -1470,13 +1470,14 @@ unsigned int utils_get_cpu_count() LTTNG_MAY_THROW
        return get_max_possible_cpu_id() + 1;
 }
 
-/**
+/*
  * Returns LTTNG_OK if the system as num_bytes available.
  *
  * If bytes_available is not NULL, the best estimate of the available memory
  * will be recorded at that address.
  */
-enum lttng_error_code utils_check_enough_available_memory(uint64_t num_bytes, uint64_t *bytes_available)
+enum lttng_error_code utils_check_enough_available_memory(uint64_t num_bytes,
+                                                         uint64_t *bytes_available)
 {
        int ret;
        enum lttng_error_code ret_code;
This page took 0.036047 seconds and 4 git commands to generate.