* SOFTWARE.
*/
-#include <babeltrace/ctf-writer/clock.h>
#include <babeltrace/ctf-ir/clock-internal.h>
#include <babeltrace/ctf-writer/writer-internal.h>
#include <babeltrace/compiler.h>
clock->precision = 1;
clock->frequency = 1000000000;
- uuid_generate(clock->uuid);
bt_ctf_ref_init(&clock->ref_count);
end:
return clock;
goto error_destroy;
}
+ ret = babeltrace_uuid_generate(clock->uuid);
+ if (ret) {
+ goto error_destroy;
+ }
+
+ clock->uuid_set = 1;
return clock;
error_destroy:
bt_ctf_clock_destroy(&clock->ref_count);
{
const unsigned char *ret;
- if (!clock) {
+ if (!clock || !clock->uuid_set) {
ret = NULL;
goto end;
}
{
int ret = 0;
- if (!clock || !uuid) {
+ if (!clock || !uuid || clock->frozen) {
ret = -1;
goto end;
}
memcpy(clock->uuid, uuid, sizeof(uuid_t));
+ clock->uuid_set = 1;
end:
return ret;
}
#include <babeltrace/ctf-ir/trace-internal.h>
#include <babeltrace/babeltrace-internal.h>
#include <glib.h>
-#include <uuid/uuid.h>
+#include <babeltrace/compat/uuid.h>
struct bt_ctf_clock {
struct bt_ctf_ref ref_count;
uint64_t offset; /* Offset in ticks */
uint64_t time; /* Current clock value */
uuid_t uuid;
+ int uuid_set;
int absolute;
/*
* A clock's properties can't be modified once it is added to a stream