X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=1d218b170ec31112f750d5ffae02ff3d41080870;hb=4f061d4cf16d6625ed8649095ee6df6922b5262a;hp=0a2f3f48fa27e08ca7881a903ef44f4dd10fcd2a;hpb=7ab02a271869642f4b34d4bd4dd9a68b3207271d;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 0a2f3f48f..1d218b170 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -155,6 +155,7 @@ static const struct option long_options[] = { { "jul-tcp-port", 1, 0, 'J' }, { "config", 1, 0, 'f' }, { "load", 1, 0, 'l' }, + { "kmod-probes", 1, 0, 'P' }, { NULL, 0, 0, 0 } }; @@ -2821,6 +2822,38 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock, break; } + /* + * Commands that need a valid session but should NOT create one if none + * exists. Instead of creating one and destroying it when the command is + * handled, process that right before so we save some round trip in useless + * code path. + */ + switch (cmd_ctx->lsm->cmd_type) { + case LTTNG_DISABLE_CHANNEL: + case LTTNG_DISABLE_EVENT: + case LTTNG_DISABLE_ALL_EVENT: + switch (cmd_ctx->lsm->domain.type) { + case LTTNG_DOMAIN_KERNEL: + if (!cmd_ctx->session->kernel_session) { + ret = LTTNG_ERR_NO_CHANNEL; + goto error; + } + break; + case LTTNG_DOMAIN_JUL: + case LTTNG_DOMAIN_UST: + if (!cmd_ctx->session->ust_session) { + ret = LTTNG_ERR_NO_CHANNEL; + goto error; + } + break; + default: + ret = LTTNG_ERR_UNKNOWN_DOMAIN; + goto error; + } + default: + break; + } + if (!need_domain) { goto skip_domain; } @@ -4132,6 +4165,7 @@ static void usage(void) fprintf(stderr, " --jul-tcp-port JUL application registration TCP port\n"); fprintf(stderr, " -f --config Load daemon configuration file\n"); fprintf(stderr, " -l --load PATH Load session configuration\n"); + fprintf(stderr, " --kmod-probes Specify kernel module probes to load\n"); } /* @@ -4258,6 +4292,9 @@ static int set_option(int opt, const char *arg, const char *optname) ret = -ENOMEM; } break; + case 'P': /* probe modules list */ + kmod_probes_list = strdup(arg); + break; case 'f': /* This is handled in set_options() thus silent break. */ break; @@ -5193,7 +5230,7 @@ int main(int argc, char **argv) ret = pthread_create(&apps_notify_thread, NULL, ust_thread_manage_notify, (void *) NULL); if (ret != 0) { - PERROR("pthread_create apps"); + PERROR("pthread_create notify"); goto exit_apps_notify; } @@ -5201,7 +5238,7 @@ int main(int argc, char **argv) ret = pthread_create(&jul_reg_thread, NULL, jul_thread_manage_registration, (void *) NULL); if (ret != 0) { - PERROR("pthread_create apps"); + PERROR("pthread_create JUL"); goto exit_jul_reg; }