Clean-up: run clang-format 14 on the tree
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 Mar 2024 19:01:10 +0000 (14:01 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 Mar 2024 19:01:10 +0000 (14:01 -0500)
Miscellaneous code style changes to correct little violations that
slipped through the cracks.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Id378ff3fa42cb69a8543b43c08d60b9a2f2c1c06

include/lttng/lttng.h
src/bin/lttng-sessiond/cmd.hpp
src/bin/lttng-sessiond/kernel.cpp
src/bin/lttng-sessiond/notification-thread-commands.cpp
src/bin/lttng/commands/enable_channels.cpp
src/bin/lttng/utils.cpp
src/common/waiter.cpp
tests/utils/tap/clock.cpp

index 404a80117d50188f4d48491c7e65324862197087..4dc24a5226cb90756bc0011f42b4945840267bee 100644 (file)
@@ -53,8 +53,8 @@
 #include <lttng/event.h>
 #include <lttng/handle.h>
 #include <lttng/health.h>
-#include <lttng/kernel.h>
 #include <lttng/kernel-probe.h>
+#include <lttng/kernel.h>
 #include <lttng/load.h>
 #include <lttng/location.h>
 #include <lttng/log-level-rule.h>
@@ -200,7 +200,8 @@ LTTNG_EXPORT extern int lttng_data_pending(const char *session_name);
  *
  * Sets the value of the argument, which must not be null.
  */
-LTTNG_EXPORT extern enum lttng_error_code lttng_get_kernel_tracer_status(enum lttng_kernel_tracer_status *status);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_get_kernel_tracer_status(enum lttng_kernel_tracer_status *status);
 
 /*
  * Deprecated, replaced by lttng_regenerate_metadata.
index 9ae371a3157644f7c5ae9e8fcb99f55c2398c90e..0039caf96a78a95de852aa66c4d37350b2443580 100644 (file)
@@ -14,6 +14,7 @@
 #include "session.hpp"
 
 #include <common/tracker.hpp>
+
 #include <lttng/kernel.h>
 
 struct notification_thread_handle;
index 1d2f8aeda10de3ba9057c658aa6f953129f89d64..4cc51a279806e8f68b217b344057eebf03908bdf 100644 (file)
@@ -2126,7 +2126,8 @@ int init_kernel_tracer()
                    "work for this session daemon.");
        }
 
-       kernel_tracer_status = nonstd::optional<enum lttng_kernel_tracer_status>(LTTNG_KERNEL_TRACER_STATUS_INITIALIZED);
+       kernel_tracer_status = nonstd::optional<enum lttng_kernel_tracer_status>(
+               LTTNG_KERNEL_TRACER_STATUS_INITIALIZED);
        return 0;
 
 error_version:
index ee0eb76b47b66712f9c95af5718a79f3a9d1b32c..2f275477b133e9c488d21beb38cdccbe6e516e6f 100644 (file)
@@ -48,7 +48,8 @@ static int run_command_wait(struct notification_thread_handle *handle,
        }
        pthread_mutex_unlock(&handle->cmd_queue.lock);
 
-       command_completion_waiter.wait();;
+       command_completion_waiter.wait();
+       ;
        return 0;
 error_unlock_queue:
        pthread_mutex_unlock(&handle->cmd_queue.lock);
@@ -62,7 +63,7 @@ notification_thread_command_copy(const struct notification_thread_command *origi
 
        try {
                new_cmd = new notification_thread_command;
-       } catch (const std::bad_alloc &e) {
+       } catch (const std::bad_alloce) {
                ERR("Failed to allocate notification_thread_command: %s", e.what());
                return nullptr;
        }
index c596dcec9cf388a21c1dbf6e64dd41a9b0253f29..4e5f2eb15534147b28ea05233600862652d3408e 100644 (file)
@@ -9,9 +9,9 @@
 #include "../command.hpp"
 #include "../utils.hpp"
 
+#include <common/lttng-kernel.hpp>
 #include <common/mi-lttng.hpp>
 #include <common/sessiond-comm/sessiond-comm.hpp>
-#include <common/lttng-kernel.hpp>
 #include <common/utils.hpp>
 
 #include <lttng/domain-internal.hpp>
index e799e2f906e5e6fed14311dfc704b5472a9d775c..26a0cf5edfe770a5ff891f82713a342e88ae34af 100644 (file)
@@ -777,9 +777,8 @@ void print_kernel_tracer_status_error()
                        std::cerr << "\tlttng-sessiond failed to open /proc/lttng" << std::endl;
                        break;
                case LTTNG_KERNEL_TRACER_STATUS_ERR_VERSION_MISMATCH:
-                       std::cerr
-                               << "\tVersion mismatch between kernel tracer and kernel tracer ABI"
-                               << std::endl;
+                       std::cerr << "\tVersion mismatch between kernel tracer and kernel tracer ABI"
+                                 << std::endl;
                        break;
                default:
                        std::cerr << lttng::format("\t\tUnknown kernel tracer status (%d)",
index 037feca2260b34d2e99cd553369e3763abb28d33..1cfd3e6f7778f14a630b4e34ff69bf6a6081214f 100644 (file)
@@ -58,8 +58,7 @@ void lttng::synchro::waiter::wait()
        }
 
        while (uatomic_read(&_state) == WAITER_WAITING) {
-               if (!futex_noasync(
-                           &_state, FUTEX_WAIT, WAITER_WAITING, nullptr, nullptr, 0)) {
+               if (!futex_noasync(&_state, FUTEX_WAIT, WAITER_WAITING, nullptr, nullptr, 0)) {
                        /*
                         * Prior queued wakeups queued by unrelated code
                         * using the same address can cause futex wait to
@@ -142,7 +141,7 @@ lttng::synchro::wait_queue::wait_queue()
        cds_wfs_init(&_stack);
 }
 
-void lttng::synchro::wait_queue::add(waiter &waiter) noexcept
+void lttng::synchro::wait_queue::add(waiterwaiter) noexcept
 {
        (void) cds_wfs_push(&_stack, &waiter._wait_queue_node);
 }
@@ -154,7 +153,7 @@ void lttng::synchro::wait_queue::wake_all()
 
        /* Wake all waiters in our stack head. */
        cds_wfs_node *iter, *iter_n;
-       cds_wfs_for_each_blocking_safe(waiters, iter, iter_n) {
+       cds_wfs_for_each_blocking_safe (waiters, iter, iter_n) {
                auto& waiter = *lttng::utils::container_of(
                        iter, &lttng::synchro::waiter::_wait_queue_node);
 
index 5a99ddda0b2dcbbb2c9b0b077804edd06fd89c8d..9af321ff92ed97b8c59f36ee1c5fdda439832b36 100644 (file)
@@ -8,11 +8,14 @@
 
 #include <stdio.h>
 
-int main() {
-   struct timespec t;
-   int ret = lttng_clock_gettime(CLOCK_MONOTONIC, &t);
-   if (ret == 0) {
-      printf("%ld.%09ld\n", t.tv_sec, t.tv_nsec);
-   }
-   return ret;
+int main()
+{
+       struct timespec t;
+       const auto ret = lttng_clock_gettime(CLOCK_MONOTONIC, &t);
+
+       if (ret == 0) {
+               printf("%ld.%09ld\n", t.tv_sec, t.tv_nsec);
+       }
+
+       return ret;
 }
This page took 0.029702 seconds and 4 git commands to generate.