static struct ltt_ust_session *usess;
static struct lttng_domain dom;
+/*
+ * Stub to prevent an undefined reference in this test without having to link
+ * the entire tree because of a cascade of dependencies. This is not used,
+ * it is just there to prevent GCC from complaining.
+ */
+int rotate_add_channel_pending(uint64_t key, enum lttng_domain_type domain,
+ struct ltt_session *session)
+{
+ ERR("Stub called instead of the real function");
+ abort();
+ return -1;
+}
+
/*
* Return random string of 10 characters.
* Not thread-safe.
{
struct ltt_ust_event *event;
struct lttng_event ev;
+ enum lttng_error_code ret;
memset(&ev, 0, sizeof(ev));
ok(lttng_strncpy(ev.name, get_random_string(),
ev.type = LTTNG_EVENT_TRACEPOINT;
ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
- event = trace_ust_create_event(&ev, NULL, NULL, NULL, false);
+ ret = trace_ust_create_event(&ev, NULL, NULL, NULL, false, &event);
- ok(event != NULL, "Create UST event");
+ ok(ret == LTTNG_OK, "Create UST event");
if (!event) {
skip(1, "UST event is null");
static void test_create_ust_event_exclusion(void)
{
+ enum lttng_error_code ret;
struct ltt_ust_event *event;
struct lttng_event ev;
char *name;
strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 1), random_name,
LTTNG_SYMBOL_NAME_LEN);
- event = trace_ust_create_event(&ev, NULL, NULL, exclusion, false);
+ ret = trace_ust_create_event(&ev, NULL, NULL, exclusion, false, &event);
exclusion = NULL;
- ok(!event, "Create UST event with identical exclusion names fails");
+ ok(ret != LTTNG_OK, "Create UST event with identical exclusion names fails");
exclusion = zmalloc(sizeof(*exclusion) +
LTTNG_SYMBOL_NAME_LEN * exclusion_count);
strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 1),
get_random_string(), LTTNG_SYMBOL_NAME_LEN);
- event = trace_ust_create_event(&ev, NULL, NULL, exclusion, false);
- ok(event != NULL, "Create UST event with different exclusion names");
+ ret = trace_ust_create_event(&ev, NULL, NULL, exclusion, false, &event);
+ ok(ret == LTTNG_OK, "Create UST event with different exclusion names");
if (!event) {
skip(1, "UST event with exclusion is null");