#include <bin/lttng-sessiond/lttng-ust-abi.h>
#include <common/defaults.h>
#include <bin/lttng-sessiond/trace-ust.h>
+#include <bin/lttng-sessiond/ust-app.h>
#include <tap/tap.h>
-#include "utils.h"
-
/* This path will NEVER be created in this test */
#define PATH1 "/tmp/.test-junk-lttng"
int lttng_opt_quiet = 1;
int lttng_opt_verbose;
+int ust_consumerd32_fd;
+int ust_consumerd64_fd;
+
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
{
dom.type = LTTNG_DOMAIN_UST;
- usess = trace_ust_create_session(PATH1, 42);
+ usess = trace_ust_create_session(42);
ok(usess != NULL, "Create UST session");
ok(usess->id == 42 &&
usess->start_trace == 0 &&
usess->domain_global.channels != NULL &&
- usess->domain_pid != NULL &&
- usess->domain_exec != NULL &&
usess->uid == 0 &&
usess->gid == 0,
"Validate UST session");
metadata->attr.num_subbuf
== DEFAULT_METADATA_SUBBUF_NUM &&
metadata->attr.switch_timer_interval
- == DEFAULT_CHANNEL_SWITCH_TIMER &&
+ == DEFAULT_METADATA_SWITCH_TIMER &&
metadata->attr.read_timer_interval
- == DEFAULT_CHANNEL_READ_TIMER &&
+ == DEFAULT_METADATA_READ_TIMER &&
metadata->attr.output == LTTNG_UST_MMAP,
"Validate UST session metadata");
strncpy(attr.name, "channel0", 8);
- uchan = trace_ust_create_channel(&attr, PATH1);
+ uchan = trace_ust_create_channel(&attr);
ok(uchan != NULL, "Create UST channel");
ok(uchan->enabled == 0 &&
- strcmp(PATH1, uchan->pathname) == 0 &&
strncmp(uchan->name, "channel0", 8) == 0 &&
uchan->name[LTTNG_UST_SYM_NAME_LEN - 1] == '\0' &&
uchan->ctx != NULL &&
ev.type = LTTNG_EVENT_TRACEPOINT;
ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
- event = trace_ust_create_event(&ev, NULL);
+ event = trace_ust_create_event(&ev, NULL, NULL);
ok(event != NULL, "Create UST event");
ok((int) uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID,
"Validate UST context");
+ free(uctx);
}
int main(int argc, char **argv)
{
- diag("UST data structures unit test");
-
plan_tests(NUM_TESTS);
+ diag("UST data structures unit test");
+
test_create_one_ust_session();
test_create_ust_metadata();
test_create_ust_channel();