Ejemplo n.º 1
0
struct bt_ctf_clock *bt_ctf_clock_create(const char *name)
{
    int ret;
    struct bt_ctf_clock *clock = NULL;

    clock = _bt_ctf_clock_create();
    if (!clock) {
        goto error;
    }

    ret = bt_ctf_clock_set_name(clock, name);
    if (ret) {
        goto error;
    }

    ret = bt_uuid_generate(clock->uuid);
    if (ret) {
        goto error;
    }

    /*
     * For backward compatibility reasons, a fresh clock can have
     * a value because it could be added to a trace created by a
     * CTF writer. As soon as this clock is added to a non-writer
     * trace, then its value/time functions will be disabled.
     */
    clock->has_value = 1;
    clock->uuid_set = 1;
    return clock;
error:
    BT_PUT(clock);
    return clock;
}
Ejemplo n.º 2
0
struct bt_ctf_clock *bt_ctf_clock_create(const char *name)
{
	int ret;
	struct bt_ctf_clock *clock = NULL;

	clock = _bt_ctf_clock_create();
	if (!clock) {
		goto error;
	}

	ret = bt_ctf_clock_set_name(clock, name);
	if (ret) {
		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);
error:
	return NULL;
}
Ejemplo n.º 3
0
struct bt_ctf_clock *bt_ctf_clock_create(const char *name)
{
	int ret;
	struct bt_ctf_clock *clock = NULL;

	clock = _bt_ctf_clock_create();
	if (!clock) {
		goto error;
	}

	ret = bt_ctf_clock_set_name(clock, name);
	if (ret) {
		goto error;
	}

	ret = bt_uuid_generate(clock->uuid);
	if (ret) {
		goto error;
	}

	clock->uuid_set = 1;
	return clock;
error:
	BT_PUT(clock);
	return clock;
}