X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftrace-ir%2Fclock-class-internal.h;fp=include%2Fbabeltrace%2Ftrace-ir%2Fclock-class-internal.h;h=0000000000000000000000000000000000000000;hp=48ab713cb567f6a350284bca3bc5b3e4a612531e;hb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;hpb=7e69c04f557e46fb50e5a888a3bc3451afbd3b8e diff --git a/include/babeltrace/trace-ir/clock-class-internal.h b/include/babeltrace/trace-ir/clock-class-internal.h deleted file mode 100644 index 48ab713c..00000000 --- a/include/babeltrace/trace-ir/clock-class-internal.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H -#define BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H - -/* - * Copyright 2017-2018 Philippe Proulx - * Copyright 2013, 2014 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct bt_clock_class { - struct bt_object base; - - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } name; - - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } description; - - uint64_t frequency; - uint64_t precision; - int64_t offset_seconds; - uint64_t offset_cycles; - - struct { - uint8_t uuid[BABELTRACE_UUID_LEN]; - - /* NULL or `uuid` above */ - bt_uuid value; - } uuid; - - bool origin_is_unix_epoch; - - /* - * This is computed every time you call - * bt_clock_class_set_frequency() or - * bt_clock_class_set_offset(), as well as initially. It is the - * base offset in nanoseconds including both `offset_seconds` - * and `offset_cycles` above in the result. It is used to - * accelerate future calls to - * bt_clock_snapshot_get_ns_from_origin() and - * bt_clock_class_cycles_to_ns_from_origin(). - * - * `overflows` is true if the base offset cannot be computed - * because of an overflow. - */ - struct { - int64_t value_ns; - bool overflows; - } base_offset; - - /* Pool of `struct bt_clock_snapshot *` */ - struct bt_object_pool cs_pool; - - bool frozen; -}; - -BT_HIDDEN -void _bt_clock_class_freeze(const struct bt_clock_class *clock_class); - -#ifdef BT_DEV_MODE -# define bt_clock_class_freeze _bt_clock_class_freeze -#else -# define bt_clock_class_freeze(_cc) -#endif - -BT_HIDDEN -bt_bool bt_clock_class_is_valid(struct bt_clock_class *clock_class); - -static inline -int bt_clock_class_clock_value_from_ns_from_origin( - struct bt_clock_class *cc, int64_t ns_from_origin, - uint64_t *raw_value) -{ - BT_ASSERT(cc); - - return bt_common_clock_value_from_ns_from_origin(cc->offset_seconds, - cc->offset_cycles, cc->frequency, ns_from_origin, - raw_value); -} - -#endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H */