X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-clock-class.cpp;fp=src%2Fbin%2Flttng-sessiond%2Fust-clock-class.cpp;h=b4a8e208bc28e665855d667a9b6b9dc7b981279c;hp=34b466f0a849332ee8fc89cd84fef16693d55bab;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d diff --git a/src/bin/lttng-sessiond/ust-clock-class.cpp b/src/bin/lttng-sessiond/ust-clock-class.cpp index 34b466f0a..b4a8e208b 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; @@ -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()) { }