Commit | Line | Data |
---|---|---|
ded1a808 MD |
1 | #ifndef LTTNG_UST_CLOCK_H |
2 | #define LTTNG_UST_CLOCK_H | |
3 | ||
4 | /* | |
5 | * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
6 | * | |
7 | * This library is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU Lesser General Public | |
9 | * License as published by the Free Software Foundation; version 2.1 of | |
10 | * the License. | |
11 | * | |
12 | * This library is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * Lesser General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public | |
18 | * License along with this library; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | */ | |
21 | ||
22 | #include <stdint.h> | |
23 | #include <stddef.h> | |
24 | ||
35a1054b SM |
25 | #ifdef __cplusplus |
26 | extern "C" { | |
27 | #endif | |
28 | ||
ded1a808 MD |
29 | /* |
30 | * Set each callback for the trace clock override, and then enable the | |
31 | * override. Those functions return negative error values on error, 0 on | |
32 | * success. | |
33 | */ | |
34 | ||
35 | /* | |
36 | * Set clock override read callback. This callback should return the | |
37 | * current clock time (a 64-bit monotonic counter). | |
38 | */ | |
39 | int lttng_ust_trace_clock_set_read64_cb(uint64_t (*read64)(void)); | |
40 | ||
41 | /* | |
42 | * Set clock override frequency callback. This callback should return | |
43 | * the frequency of the clock in cycles per second. | |
44 | */ | |
45 | int lttng_ust_trace_clock_set_freq_cb(uint64_t (*freq)(void)); | |
46 | ||
47 | /* | |
48 | * Set clock override unique identifier. | |
49 | * LTTNG_UST_UUID_STR_LEN is the maximum length of uuid string. Includes | |
50 | * final \0. | |
51 | */ | |
52 | #define LTTNG_UST_UUID_STR_LEN 37 | |
53 | ||
54 | int lttng_ust_trace_clock_set_uuid_cb(int (*uuid)(char *uuid)); | |
55 | ||
56 | /* | |
57 | * Set clock override name. | |
58 | */ | |
59 | int lttng_ust_trace_clock_set_name_cb(const char *(*name)(void)); | |
60 | ||
61 | /* | |
62 | * Set clock override description. | |
63 | */ | |
64 | int lttng_ust_trace_clock_set_description_cb(const char *(*description)(void)); | |
65 | ||
66 | /* | |
67 | * Use the clock override rather than the default clock. | |
68 | */ | |
69 | int lttng_ust_enable_trace_clock_override(void); | |
70 | ||
35a1054b SM |
71 | #ifdef __cplusplus |
72 | } | |
73 | #endif | |
74 | ||
ded1a808 | 75 | #endif /* LTTNG_UST_CLOCK_H */ |