* component class name.
*
* On success, both *plugin and *component are not NULL. *plugin
- * and *component are owned by the caller. On success, *name can be NULL
- * if no component name was found, and *comp_cls_type is set.
+ * and *comp_cls are owned by the caller. On success, *name can be NULL
+ * if no component class name was found, and *comp_cls_type is set.
*/
static
void plugin_comp_cls_names(const char *arg, char **name, char **plugin,
OPT_COMPONENT,
OPT_CONNECT,
OPT_DEBUG,
+ OPT_DEBUG_INFO,
OPT_DEBUG_INFO_DIR,
OPT_DEBUG_INFO_FULL_PATH,
OPT_DEBUG_INFO_TARGET_PREFIX,
OPT_LIST,
OPT_NAME,
OPT_NAMES,
- OPT_NO_DEBUG_INFO,
OPT_NO_DELTA,
OPT_OMIT_HOME_PLUGIN_PATH,
OPT_OMIT_SYSTEM_PLUGIN_PATH,
void print_help_usage(FILE *fp)
{
fprintf(fp, "Usage: babeltrace [GENERAL OPTIONS] help [OPTIONS] PLUGIN\n");
- fprintf(fp, " babeltrace [GENERAL OPTIONS] help [OPTIONS] --component=TYPE.PLUGIN.CLS\n");
+ fprintf(fp, " babeltrace [GENERAL OPTIONS] help [OPTIONS] TYPE.PLUGIN.CLS\n");
fprintf(fp, "\n");
fprintf(fp, "Options:\n");
fprintf(fp, "\n");
- fprintf(fp, " -c, --component=TYPE.PLUGIN.CLS Get help for the component class CLS of\n");
- fprintf(fp, " type TYPE (`source`, `filter`, or `sink`)\n");
- fprintf(fp, " found in the plugin PLUGIN\n");
fprintf(fp, " --omit-home-plugin-path Omit home plugins from plugin search path\n");
fprintf(fp, " (~/.local/lib/babeltrace/plugins)\n");
fprintf(fp, " --omit-system-plugin-path Omit system plugins from plugin search path\n");
static
struct poptOption help_long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
- { "component", 'c', POPT_ARG_STRING, NULL, OPT_COMPONENT, NULL, NULL },
{ "help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL },
{ "omit-home-plugin-path", '\0', POPT_ARG_NONE, NULL, OPT_OMIT_HOME_PLUGIN_PATH, NULL, NULL },
{ "omit-system-plugin-path", '\0', POPT_ARG_NONE, NULL, OPT_OMIT_SYSTEM_PLUGIN_PATH, NULL, NULL },
struct bt_config *cfg = NULL;
const char *leftover;
char *plugin_name = NULL, *comp_cls_name = NULL;
- char *plug_comp_cls_names = NULL;
*retcode = 0;
cfg = bt_config_help_create(initial_plugin_paths);
case OPT_OMIT_HOME_PLUGIN_PATH:
cfg->omit_home_plugin_path = true;
break;
- case OPT_COMPONENT:
- if (plug_comp_cls_names) {
- printf_err("Cannot specify more than one plugin and component class:\n %s\n",
- arg);
- goto error;
- }
-
- plug_comp_cls_names = strdup(arg);
- if (!plug_comp_cls_names) {
- print_err_oom();
- goto error;
- }
- break;
case OPT_HELP:
print_help_usage(stdout);
*retcode = -1;
leftover = poptGetArg(pc);
if (leftover) {
- if (plug_comp_cls_names) {
- printf_err("Cannot specify plugin name and --component component class:\n %s\n",
- leftover);
- goto error;
- }
-
- g_string_assign(cfg->cmd_data.help.cfg_component->plugin_name,
- leftover);
- } else {
- if (!plug_comp_cls_names) {
- print_help_usage(stdout);
- *retcode = -1;
- BT_PUT(cfg);
- goto end;
- }
-
- plugin_comp_cls_names(plug_comp_cls_names, NULL,
+ plugin_comp_cls_names(leftover, NULL,
&plugin_name, &comp_cls_name,
&cfg->cmd_data.help.cfg_component->type);
if (plugin_name && comp_cls_name) {
- g_string_assign(cfg->cmd_data.help.cfg_component->plugin_name,
+ /* Component class help */
+ g_string_assign(
+ cfg->cmd_data.help.cfg_component->plugin_name,
plugin_name);
- g_string_assign(cfg->cmd_data.help.cfg_component->comp_cls_name,
+ g_string_assign(
+ cfg->cmd_data.help.cfg_component->comp_cls_name,
comp_cls_name);
} else {
- printf_err("Invalid --component option's argument:\n %s\n",
- plug_comp_cls_names);
- goto error;
+ /* Fall back to plugin help */
+ cfg->cmd_data.help.cfg_component->type =
+ BT_COMPONENT_CLASS_TYPE_UNKNOWN;
+ g_string_assign(
+ cfg->cmd_data.help.cfg_component->plugin_name,
+ leftover);
}
+ } else {
+ print_help_usage(stdout);
+ *retcode = -1;
+ BT_PUT(cfg);
+ goto end;
}
if (append_home_and_system_plugin_paths_cfg(cfg)) {
BT_PUT(cfg);
end:
- free(plug_comp_cls_names);
g_free(plugin_name);
g_free(comp_cls_name);
fprintf(fp, " --run-args-0 Print the equivalent arguments for the\n");
fprintf(fp, " `run` command to the standard output,\n");
fprintf(fp, " formatted for `xargs -0`, and quit\n");
+ fprintf(fp, " --stream-intersection Only process events when all streams\n");
+ fprintf(fp, " are active\n");
fprintf(fp, " -u, --url=URL Set the `url` string parameter of the\n");
fprintf(fp, " current component to URL\n");
fprintf(fp, " -h, --help Show this help and quit\n");
fprintf(fp, "\n");
fprintf(fp, " --clock-offset=SEC Set clock offset to SEC seconds\n");
fprintf(fp, " --clock-offset-ns=NS Set clock offset to NS ns\n");
- fprintf(fp, " --stream-intersection Only process events when all streams\n");
- fprintf(fp, " are active\n");
fprintf(fp, "\n");
fprintf(fp, "Implicit `sink.text.pretty` component options:\n");
fprintf(fp, "\n");
fprintf(fp, "\n");
fprintf(fp, "Implicit `filter.lttng-utils.debug-info` component options:\n");
fprintf(fp, "\n");
+ fprintf(fp, " --debug-info Create an implicit\n");
+ fprintf(fp, " `filter.lttng-utils.debug-info` component\n");
fprintf(fp, " --debug-info-dir=DIR Search for debug info in directory DIR\n");
fprintf(fp, " instead of `/usr/lib/debug`\n");
fprintf(fp, " --debug-info-full-path Show full debug info source and\n");
fprintf(fp, " Use directory DIR as a prefix when\n");
fprintf(fp, " looking up executables during debug\n");
fprintf(fp, " info analysis\n");
- fprintf(fp, " --no-debug-info Do not create an implicit\n");
- fprintf(fp, " `lttng-utils.debug-info` filter component\n");
fprintf(fp, "\n");
fprintf(fp, "Legacy options that still work:\n");
fprintf(fp, "\n");
{ "input-format", 'i', POPT_ARG_STRING, NULL, OPT_INPUT_FORMAT, NULL, NULL },
{ "name", '\0', POPT_ARG_STRING, NULL, OPT_NAME, NULL, NULL },
{ "names", 'n', POPT_ARG_STRING, NULL, OPT_NAMES, NULL, NULL },
- { "no-debug-info", '\0', POPT_ARG_NONE, NULL, OPT_NO_DEBUG_INFO, NULL, NULL },
+ { "debug-info", '\0', POPT_ARG_NONE, NULL, OPT_DEBUG_INFO, NULL, NULL },
{ "no-delta", '\0', POPT_ARG_NONE, NULL, OPT_NO_DELTA, NULL, NULL },
{ "omit-home-plugin-path", '\0', POPT_ARG_NONE, NULL, OPT_OMIT_HOME_PLUGIN_PATH, NULL, NULL },
{ "omit-system-plugin-path", '\0', POPT_ARG_NONE, NULL, OPT_OMIT_SYSTEM_PLUGIN_PATH, NULL, NULL },
static
struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
int *retcode, bool force_omit_system_plugin_path,
- bool force_omit_home_plugin_path, bool force_no_debug_info,
+ bool force_omit_home_plugin_path,
struct bt_value *initial_plugin_paths, char *log_level)
{
poptContext pc = NULL;
}
if (init_implicit_component_args(&implicit_debug_info_args,
- "filter.lttng-utils.debug-info", !force_no_debug_info)) {
+ "filter.lttng-utils.debug-info", false)) {
goto error;
}
case OPT_CLOCK_SECONDS:
case OPT_COLOR:
case OPT_DEBUG:
+ case OPT_DEBUG_INFO:
case OPT_DEBUG_INFO_DIR:
case OPT_DEBUG_INFO_FULL_PATH:
case OPT_DEBUG_INFO_TARGET_PREFIX:
case OPT_FIELDS:
case OPT_INPUT_FORMAT:
case OPT_NAMES:
- case OPT_NO_DEBUG_INFO:
case OPT_NO_DELTA:
case OPT_OUTPUT_FORMAT:
case OPT_OUTPUT:
goto error;
}
break;
- case OPT_NO_DEBUG_INFO:
- implicit_debug_info_args.exists = false;
+ case OPT_DEBUG_INFO:
+ implicit_debug_info_args.exists = true;
break;
case OPT_DEBUG_INFO_DIR:
implicit_debug_info_args.exists = true;
ret = append_implicit_component_extra_param(
- &implicit_debug_info_args, "dir", arg);
+ &implicit_debug_info_args, "debug-info-dir", arg);
if (ret) {
goto error;
}
struct bt_config *bt_config_cli_args_create(int argc, const char *argv[],
int *retcode, bool force_omit_system_plugin_path,
- bool force_omit_home_plugin_path, bool force_no_debug_info,
+ bool force_omit_home_plugin_path,
struct bt_value *initial_plugin_paths)
{
struct bt_config *config = NULL;
}
if (argc <= 1) {
+ print_version();
+ puts("");
print_gen_usage(stdout);
goto end;
}
case COMMAND_TYPE_CONVERT:
config = bt_config_convert_from_args(command_argc, command_argv,
retcode, force_omit_system_plugin_path,
- force_omit_home_plugin_path, force_no_debug_info,
+ force_omit_home_plugin_path,
initial_plugin_paths, &log_level);
break;
case COMMAND_TYPE_LIST_PLUGINS: