2 * Copyright (C) 2010 Pierre-Marc Fournier
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: GPL-2.0-only
12 #include <common/compat/time.h>
17 #include <urcu/system.h>
18 #include <urcu/arch.h>
19 #include <lttng/ust-clock.h>
21 #include <common/uuid.h>
24 uint64_t trace_clock_read64(void)
26 uint64_t clock_value
= 0;
27 lttng_ust_clock_read64_function read64_cb
;
29 if (lttng_ust_trace_clock_get_read64_cb(&read64_cb
)) {
33 clock_value
= read64_cb();
39 uint64_t trace_clock_freq(void)
41 uint64_t frequency
= 0;
42 lttng_ust_clock_freq_function get_freq_cb
;
44 if (lttng_ust_trace_clock_get_freq_cb(&get_freq_cb
)) {
48 frequency
= get_freq_cb();
54 int trace_clock_uuid(char *uuid
)
57 lttng_ust_clock_uuid_function get_uuid_cb
;
59 if (lttng_ust_trace_clock_get_uuid_cb(&get_uuid_cb
)) {
64 ret
= get_uuid_cb(uuid
);
71 const char *trace_clock_name(void)
74 lttng_ust_clock_name_function get_name_cb
;
76 if (lttng_ust_trace_clock_get_name_cb(&get_name_cb
)) {
87 const char *trace_clock_description(void)
89 const char *description
;
90 lttng_ust_clock_description_function get_description_cb
;
92 if (lttng_ust_trace_clock_get_description_cb(&get_description_cb
)) {
97 description
= get_description_cb();
102 #endif /* _UST_CLOCK_H */