X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.c;h=e836943991da04d16c9c0764230cd4e3ca6367e6;hb=1ceda6f154db93be802eeea64bc9eb49840fd402;hp=28b007b2402889d8782473033eee8119258ebc73;hpb=58f237ca4b04da3423263585b5cfa57845c44952;p=lttng-tools.git diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c index 28b007b24..e83694399 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -26,11 +26,6 @@ #include "utils.h" #include "command.h" -static const char *str_kernel = "Kernel"; -static const char *str_ust = "UST"; -static const char *str_jul = "JUL"; -static const char *str_log4j = "LOG4J"; -static const char *str_python = "Python"; static const char *str_all = "ALL"; static const char *str_tracepoint = "Tracepoint"; static const char *str_syscall = "Syscall"; @@ -128,6 +123,24 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) } } +/* + * Same as list_cmd_options, but for options specified for argpar. + */ +void list_cmd_options_argpar(FILE *ofp, const struct argpar_opt_descr *options) +{ + int i; + + for (i = 0; options[i].long_name != NULL; i++) { + const struct argpar_opt_descr *option = &options[i]; + + fprintf(ofp, "--%s\n", option->long_name); + + if (isprint(option->short_name)) { + fprintf(ofp, "-%c\n", option->short_name); + } + } +} + /* * fls: returns the position of the most significant bit. * Returns 0 if no bit is set, else returns the position of the most @@ -280,34 +293,6 @@ int get_count_order_ulong(unsigned long x) return fls_ulong(x - 1); } -const char *get_domain_str(enum lttng_domain_type domain) -{ - const char *str_dom; - - switch (domain) { - case LTTNG_DOMAIN_KERNEL: - str_dom = str_kernel; - break; - case LTTNG_DOMAIN_UST: - str_dom = str_ust; - break; - case LTTNG_DOMAIN_JUL: - str_dom = str_jul; - break; - case LTTNG_DOMAIN_LOG4J: - str_dom = str_log4j; - break; - case LTTNG_DOMAIN_PYTHON: - str_dom = str_python; - break; - default: - /* Should not have an unknown domain or else define it. */ - assert(0); - } - - return str_dom; -} - const char *get_event_type_str(enum lttng_event_type type) { const char *str_event_type;