{ "jul-tcp-port", 1, 0, 'J' },
{ "config", 1, 0, 'f' },
{ "load", 1, 0, 'l' },
+ { "kmod-probes", 1, 0, 'P' },
{ NULL, 0, 0, 0 }
};
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;
}
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");
}
/*
break;
case 'g':
tracing_group_name = strdup(arg);
+ if (!tracing_group_name) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
break;
case 'h':
usage();
if (arg) {
lttng_opt_verbose = config_parse_value(arg);
} else {
- lttng_opt_verbose += 1;
+ /* Only 3 level of verbosity (-vvv). */
+ if (lttng_opt_verbose < 3) {
+ lttng_opt_verbose += 1;
+ }
}
break;
case 'Z':
break;
case 'u':
consumerd32_bin = strdup(arg);
+ if (!consumerd32_bin) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
consumerd32_bin_override = 1;
break;
case 'U':
consumerd32_libdir = strdup(arg);
+ if (!consumerd32_libdir) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
consumerd32_libdir_override = 1;
break;
case 't':
consumerd64_bin = strdup(arg);
+ if (!consumerd64_bin) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
consumerd64_bin_override = 1;
break;
case 'T':
consumerd64_libdir = strdup(arg);
+ if (!consumerd64_libdir) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
consumerd64_libdir_override = 1;
break;
case 'p':
opt_pidfile = strdup(arg);
+ if (!opt_pidfile) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
break;
case 'J': /* JUL TCP port. */
{
ret = -ENOMEM;
}
break;
+ case 'P': /* probe modules list */
+ kmod_probes_list = strdup(arg);
+ if (!kmod_probes_list) {
+ perror("strdup");
+ ret = -ENOMEM;
+ }
+ break;
case 'f':
/* This is handled in set_options() thus silent break. */
break;