Custom upgrade: suffix clock plugin symbols with 1
[lttng-ust.git] / include / lttng / ust-clock.h
CommitLineData
ded1a808 1/*
c0c0989a 2 * SPDX-License-Identifier: LGPL-2.1-only
ded1a808 3 *
c0c0989a 4 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ded1a808
MD
5 */
6
c0c0989a
MJ
7#ifndef LTTNG_UST_CLOCK_H
8#define LTTNG_UST_CLOCK_H
9
ded1a808
MD
10#include <stdint.h>
11#include <stddef.h>
70336267 12#include <lttng/ust-config.h>
ded1a808 13
e7eaa1d2
SM
14#ifdef __cplusplus
15extern "C" {
16#endif
17
ded1a808
MD
18/*
19 * Set each callback for the trace clock override, and then enable the
20 * override. Those functions return negative error values on error, 0 on
21 * success.
22 */
23
33b563d6
MD
24typedef uint64_t (*lttng_ust_clock_read64_function)(void);
25typedef uint64_t (*lttng_ust_clock_freq_function)(void);
26typedef int (*lttng_ust_clock_uuid_function)(char *uuid);
27typedef const char *(*lttng_ust_clock_name_function)(void);
28typedef const char *(*lttng_ust_clock_description_function)(void);
29
70336267
MD
30/* Custom upgrade 2.12 to 2.13 */
31
32#ifndef LTTNG_UST_CUSTOM_UPGRADE_CONFLICTING_SYMBOLS
33#define lttng_ust_trace_clock_set_read64_cb lttng_ust_trace_clock_set_read64_cb1
34#define lttng_ust_trace_clock_set_freq_cb lttng_ust_trace_clock_set_freq_cb1
35#define lttng_ust_trace_clock_set_uuid_cb lttng_ust_trace_clock_set_uuid_cb1
36#define lttng_ust_trace_clock_set_name_cb lttng_ust_trace_clock_set_name_cb1
37#define lttng_ust_trace_clock_set_description_cb lttng_ust_trace_clock_set_description_cb1
38#define lttng_ust_enable_trace_clock_override lttng_ust_enable_trace_clock_override1
39#endif
40
ded1a808 41/*
33b563d6 42 * Set/Get clock override read callback. This callback should return the
ded1a808
MD
43 * current clock time (a 64-bit monotonic counter).
44 */
33b563d6
MD
45int lttng_ust_trace_clock_set_read64_cb(lttng_ust_clock_read64_function read64_cb);
46int lttng_ust_trace_clock_get_read64_cb(lttng_ust_clock_read64_function *read64_cb);
ded1a808
MD
47
48/*
33b563d6 49 * Set/Get clock override frequency callback. This callback should return
ded1a808
MD
50 * the frequency of the clock in cycles per second.
51 */
33b563d6
MD
52int lttng_ust_trace_clock_set_freq_cb(lttng_ust_clock_freq_function freq_cb);
53int lttng_ust_trace_clock_get_freq_cb(lttng_ust_clock_freq_function *freq_cb);
ded1a808
MD
54
55/*
33b563d6 56 * Set/Get clock override unique identifier.
ded1a808
MD
57 * LTTNG_UST_UUID_STR_LEN is the maximum length of uuid string. Includes
58 * final \0.
59 */
60#define LTTNG_UST_UUID_STR_LEN 37
61
33b563d6
MD
62int lttng_ust_trace_clock_set_uuid_cb(lttng_ust_clock_uuid_function uuid_cb);
63int lttng_ust_trace_clock_get_uuid_cb(lttng_ust_clock_uuid_function *uuid_cb);
ded1a808
MD
64
65/*
33b563d6 66 * Set/Get clock override name.
ded1a808 67 */
33b563d6
MD
68int lttng_ust_trace_clock_set_name_cb(lttng_ust_clock_name_function name_cb);
69int lttng_ust_trace_clock_get_name_cb(lttng_ust_clock_name_function *name_cb);
ded1a808
MD
70
71/*
33b563d6 72 * Set/Get clock override description.
ded1a808 73 */
33b563d6
MD
74int lttng_ust_trace_clock_set_description_cb(lttng_ust_clock_description_function description_cb);
75int lttng_ust_trace_clock_get_description_cb(lttng_ust_clock_description_function *description_cb);
ded1a808
MD
76
77/*
78 * Use the clock override rather than the default clock.
79 */
80int lttng_ust_enable_trace_clock_override(void);
81
e7eaa1d2
SM
82#ifdef __cplusplus
83}
84#endif
85
ded1a808 86#endif /* LTTNG_UST_CLOCK_H */
This page took 0.038785 seconds and 5 git commands to generate.