a38cd515e217cfaee7cc55845f285790dd8067f2
2 * lttng-clock-override-test.c
4 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * Copyright (C) 2015 Jonthan Rajotte <jonathan.rajotte-julien@efficios.com>
7 * SPDX-License-Identifier: MIT
9 * Based on lttng-clock-override-example.c from LTTng-ust example
14 #include <common/compat/time.hpp>
17 #include <lttng/lttng-export.h>
18 #include <lttng/ust-clock.h>
21 uint64_t plugin_read64(void)
28 uint64_t plugin_freq(void)
30 return 1000; /* 1KHz clock (very coarse!) */
34 int plugin_uuid(char *uuid
)
36 const char myuuid
[] = "83c63deb-7aa4-48fb-abda-946f400d76e6";
37 memcpy(uuid
, myuuid
, LTTNG_UST_UUID_STR_LEN
);
42 const char *plugin_name(void)
44 return "lttng_test_clock_override";
48 const char *plugin_description(void)
50 return "Freeze time with 1KHz for regression test";
53 LTTNG_EXPORT
void lttng_ust_clock_plugin_init(void);
54 void lttng_ust_clock_plugin_init(void)
58 ret
= lttng_ust_trace_clock_set_read64_cb(plugin_read64
);
60 fprintf(stderr
, "Error setting clock override read64 callback: %s\n",
64 ret
= lttng_ust_trace_clock_set_freq_cb(plugin_freq
);
66 fprintf(stderr
, "Error setting clock override freq callback: %s\n",
70 ret
= lttng_ust_trace_clock_set_uuid_cb(plugin_uuid
);
72 fprintf(stderr
, "Error setting clock override uuid callback: %s\n",
77 ret
= lttng_ust_trace_clock_set_name_cb(plugin_name
);
79 fprintf(stderr
, "Error setting clock override name callback: %s\n",
84 ret
= lttng_ust_trace_clock_set_description_cb(plugin_description
);
86 fprintf(stderr
, "Error setting clock override description callback: %s\n",
91 ret
= lttng_ust_enable_trace_clock_override();
93 fprintf(stderr
, "Error enabling clock override: %s\n",
This page took 0.030476 seconds and 4 git commands to generate.