{
int ret;
pid_t pid;
+ const char *consumer_to_use;
const char *verbosity;
+ struct stat st;
DBG("Spawning consumerd");
}
switch (consumer_data->type) {
case LTTNG_CONSUMER_KERNEL:
- execl(INSTALL_BIN_PATH "/" CONSUMERD_FILE,
- "lttng-consumerd", verbosity, "-k",
- "--consumerd-cmd-sock", consumer_data->cmd_unix_sock_path,
- "--consumerd-err-sock", consumer_data->err_unix_sock_path,
- NULL);
+ /*
+ * Find out which consumerd to execute. We will first
+ * try the 64-bit path, then the 32-bit one, then
+ * fallback on sessiond's installation directory.
+ */
+ if (stat(consumerd64_bin, &st) == 0) {
+ consumer_to_use = consumerd64_bin;
+ } else if (stat(consumerd32_bin, &st) == 0) {
+ consumer_to_use = consumerd32_bin;
+ } else if (stat(INSTALL_BIN_PATH "/" CONSUMERD_FILE, &st) == 0) {
+ consumer_to_use = INSTALL_BIN_PATH "/" CONSUMERD_FILE;
+ } else {
+ break;
+ }
+ DBG("Using kernel consumer at: %s", consumer_to_use);
+ execl(consumer_to_use,
+ "lttng-consumerd", verbosity, "-k",
+ "--consumerd-cmd-sock", consumer_data->cmd_unix_sock_path,
+ "--consumerd-err-sock", consumer_data->err_unix_sock_path,
+ NULL);
break;
case LTTNG_CONSUMER64_UST:
{
goto error;
}
}
+ DBG("Using 64-bit UST consumer at: %s", consumerd64_bin);
ret = execl(consumerd64_bin, verbosity, "-u",
"--consumerd-cmd-sock", consumer_data->cmd_unix_sock_path,
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
goto error;
}
}
+ DBG("Using 32-bit UST consumer at: %s", consumerd32_bin);
ret = execl(consumerd32_bin, verbosity, "-u",
"--consumerd-cmd-sock", consumer_data->cmd_unix_sock_path,
"--consumerd-err-sock", consumer_data->err_unix_sock_path,
tmp[i].type = LTTNG_EVENT_FUNCTION;
break;
case LTTNG_UST_TRACEPOINT_LOGLEVEL:
- /* TODO */
- ret = -LTTCOMM_NOT_IMPLEMENTED;
- goto error;
+ tmp[i].type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL;
break;
}
i++;
/*
* Command LTTNG_ENABLE_EVENT processed by the client thread.
+ *
+ * TODO: currently, both events and loglevels are kept within the same
+ * namespace for UST global registry/app registery, so if an event
+ * happen to have the same name as the loglevel (very unlikely though),
+ * and an attempt is made to enable/disable both in the same session,
+ * the first to be created will be the only one allowed to exist.
*/
static int cmd_enable_event(struct ltt_session *session, int domain,
char *channel_name, struct lttng_event *event)