#include <unistd.h>
#include <urcu/list.h> /* URCU list library (-lurcu) */
-#include <ust/ustctl.h> /* UST control lib (-lust) */
#include <lttng/lttng.h>
#include "liblttsessiondcomm.h"
#include "session.h"
#include "traceable-app.h"
#include "lttng-kconsumerd.h"
+#include "libustctl.h"
/*
* TODO:
sock = ustctl_connect_pid(lta->pid);
if (sock < 0) {
- ERR("Fail connecting to the PID %d\n", pid);
+ ERR("Fail connecting to the PID %d", pid);
}
return sock;
/* Create all channel directories */
cds_list_for_each_entry(chan, &session->channel_list.head, list) {
DBG("Creating trace directory at %s", chan->pathname);
+ // TODO: recursive create dir
ret = mkdir(chan->pathname, S_IRWXU | S_IRWXG );
if (ret < 0) {
- perror("mkdir trace path");
- ret = -errno;
- goto error;
+ if (ret != EEXIST) {
+ perror("mkdir trace path");
+ ret = -errno;
+ goto error;
+ }
}
}
continue;
}
+ // TODO: Validate cmd_ctx including sanity check for security purpose.
+
/*
* This function dispatch the work to the kernel or userspace tracer
* libs and fill the lttcomm_lttng_msg data structure of all the needed
ret = mkdir(KCONSUMERD_PATH, S_IRWXU | S_IRWXG);
if (ret < 0) {
- ERR("Failed to create " KCONSUMERD_PATH);
- goto error;
+ if (errno != EEXIST) {
+ ERR("Failed to create " KCONSUMERD_PATH);
+ goto error;
+ }
+ ret = 0;
}
/* Create the kconsumerd error unix socket */