X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-clock-class.cpp;h=cdb3b50a5fe5154c57322eed7f4db975ae0b8f9d;hb=HEAD;hp=34b466f0a849332ee8fc89cd84fef16693d55bab;hpb=d7bfb9b0fa35679d3e728b9165699d9faf905539;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-clock-class.cpp b/src/bin/lttng-sessiond/ust-clock-class.cpp index 34b466f0a..cdb3b50a5 100644 --- a/src/bin/lttng-sessiond/ust-clock-class.cpp +++ b/src/bin/lttng-sessiond/ust-clock-class.cpp @@ -9,12 +9,12 @@ #include "ust-clock-class.hpp" -#include #include +#include #include -#define CLOCK_OFFSET_SAMPLE_COUNT 10 +#define CLOCK_OFFSET_SAMPLE_COUNT 10 namespace lst = lttng::sessiond::trace; @@ -66,7 +66,7 @@ nonstd::optional sample_clock_uuid() LTTNG_THROW_ERROR("Failed to parse UUID from string"); } - return nonstd::optional{uuid}; + return nonstd::optional{ uuid }; } const char *sample_clock_name() @@ -79,7 +79,8 @@ const char *sample_clock_name() const auto name = get_name_cb(); if (!name) { - LTTNG_THROW_ERROR("Invalid clock name returned by LTTng-UST `lttng_ust_clock_name_function`"); + LTTNG_THROW_ERROR( + "Invalid clock name returned by LTTng-UST `lttng_ust_clock_name_function`"); } return name; @@ -95,7 +96,8 @@ const char *sample_clock_description() const auto description = get_description_cb(); if (!description) { - LTTNG_THROW_ERROR("Invalid clock description returned by LTTng-UST `lttng_ust_clock_description_function`"); + LTTNG_THROW_ERROR( + "Invalid clock description returned by LTTng-UST `lttng_ust_clock_description_function`"); } return description; @@ -107,8 +109,7 @@ const char *sample_clock_description() */ void measure_single_clock_offset(struct offset_sample *sample) { - lst::clock_class::cycles_t monotonic_avg, monotonic[2], measure_delta, - realtime; + lst::clock_class::cycles_t monotonic_avg, monotonic[2], measure_delta, realtime; const auto tcf = sample_clock_frequency(); struct timespec rts = { 0, 0 }; @@ -132,8 +133,7 @@ void measure_single_clock_offset(struct offset_sample *sample) if (tcf == NSEC_PER_SEC) { realtime += rts.tv_nsec; } else { - realtime += (lst::clock_class::cycles_t) rts.tv_nsec * tcf / - NSEC_PER_SEC; + realtime += (lst::clock_class::cycles_t) rts.tv_nsec * tcf / NSEC_PER_SEC; } sample->offset = (lst::clock_class::scycles_t) realtime - monotonic_avg; @@ -146,7 +146,7 @@ void measure_single_clock_offset(struct offset_sample *sample) * to complete, thus removing imprecision caused by preemption. * May return a negative offset. */ -lst::clock_class::scycles_t measure_clock_offset(void) +lst::clock_class::scycles_t measure_clock_offset() { struct offset_sample offset_best_sample = { .offset = 0, @@ -163,9 +163,9 @@ lst::clock_class::scycles_t measure_clock_offset(void) lttng::sessiond::ust::clock_class::clock_class() : lst::clock_class(sample_clock_name(), - sample_clock_description(), - sample_clock_uuid(), - measure_clock_offset(), - sample_clock_frequency()) + sample_clock_description(), + sample_clock_uuid(), + measure_clock_offset(), + sample_clock_frequency()) { }