From: Jérémie Galarneau Date: Thu, 7 Mar 2024 19:01:10 +0000 (-0500) Subject: Clean-up: run clang-format 14 on the tree X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=11927a7859022cf38a4153767cc96fda4987070d Clean-up: run clang-format 14 on the tree Miscellaneous code style changes to correct little violations that slipped through the cracks. Signed-off-by: Jérémie Galarneau Change-Id: Id378ff3fa42cb69a8543b43c08d60b9a2f2c1c06 --- diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 404a80117..4dc24a522 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -53,8 +53,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -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. diff --git a/src/bin/lttng-sessiond/cmd.hpp b/src/bin/lttng-sessiond/cmd.hpp index 9ae371a31..0039caf96 100644 --- a/src/bin/lttng-sessiond/cmd.hpp +++ b/src/bin/lttng-sessiond/cmd.hpp @@ -14,6 +14,7 @@ #include "session.hpp" #include + #include struct notification_thread_handle; diff --git a/src/bin/lttng-sessiond/kernel.cpp b/src/bin/lttng-sessiond/kernel.cpp index 1d2f8aeda..4cc51a279 100644 --- a/src/bin/lttng-sessiond/kernel.cpp +++ b/src/bin/lttng-sessiond/kernel.cpp @@ -2126,7 +2126,8 @@ int init_kernel_tracer() "work for this session daemon."); } - kernel_tracer_status = nonstd::optional(LTTNG_KERNEL_TRACER_STATUS_INITIALIZED); + kernel_tracer_status = nonstd::optional( + LTTNG_KERNEL_TRACER_STATUS_INITIALIZED); return 0; error_version: diff --git a/src/bin/lttng-sessiond/notification-thread-commands.cpp b/src/bin/lttng-sessiond/notification-thread-commands.cpp index ee0eb76b4..2f275477b 100644 --- a/src/bin/lttng-sessiond/notification-thread-commands.cpp +++ b/src/bin/lttng-sessiond/notification-thread-commands.cpp @@ -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_alloc& e) { ERR("Failed to allocate notification_thread_command: %s", e.what()); return nullptr; } diff --git a/src/bin/lttng/commands/enable_channels.cpp b/src/bin/lttng/commands/enable_channels.cpp index c596dcec9..4e5f2eb15 100644 --- a/src/bin/lttng/commands/enable_channels.cpp +++ b/src/bin/lttng/commands/enable_channels.cpp @@ -9,9 +9,9 @@ #include "../command.hpp" #include "../utils.hpp" +#include #include #include -#include #include #include diff --git a/src/bin/lttng/utils.cpp b/src/bin/lttng/utils.cpp index e799e2f90..26a0cf5ed 100644 --- a/src/bin/lttng/utils.cpp +++ b/src/bin/lttng/utils.cpp @@ -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)", diff --git a/src/common/waiter.cpp b/src/common/waiter.cpp index 037feca22..1cfd3e6f7 100644 --- a/src/common/waiter.cpp +++ b/src/common/waiter.cpp @@ -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(waiter& waiter) 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, <tng::synchro::waiter::_wait_queue_node); diff --git a/tests/utils/tap/clock.cpp b/tests/utils/tap/clock.cpp index 5a99ddda0..9af321ff9 100644 --- a/tests/utils/tap/clock.cpp +++ b/tests/utils/tap/clock.cpp @@ -8,11 +8,14 @@ #include -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; }