X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fadd_context.c;h=2f43dc7ff203e53a411d7178e649d80dd590d824;hp=56ee2aca44a82e7157526c87c9fed9332a486bd0;hb=62a7b8edf965b89d3ca57da120dcedfcf36dfe02;hpb=4ba92f185fb1d0b112cbc804a261939f5f81dc34 diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index 56ee2aca4..2f43dc7ff 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -490,48 +490,6 @@ static void print_ctx_type(FILE *ofp) } } -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng add-context -t TYPE [-k|-u] [OPTIONS]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "If no channel is given (-c), the context is added to\n"); - fprintf(ofp, "all channels.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Otherwise the context is added only to the channel (-c).\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Exactly one domain (-k or -u) must be specified.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options Simple listing of options\n"); - fprintf(ofp, " -s, --session NAME Apply to session name\n"); - fprintf(ofp, " -c, --channel NAME Apply to channel\n"); - fprintf(ofp, " -k, --kernel Apply to the kernel tracer\n"); - fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n"); - fprintf(ofp, " -j, --jul Apply to Java application using JUL\n"); - fprintf(ofp, " -l, --log4j Apply for Java application using LOG4j\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Context:\n"); - fprintf(ofp, " -t, --type TYPE Context type. You can repeat that option on\n"); - fprintf(ofp, " the command line to specify multiple contexts at once.\n"); - fprintf(ofp, " (--kernel preempts --userspace)\n"); - fprintf(ofp, " TYPE can be one of the strings below:\n"); - print_ctx_type(ofp); - fprintf(ofp, "\n"); - fprintf(ofp, "Note that the vpid, vppid and vtid context types represent the virtual process id,\n" - "virtual parent process id and virtual thread id as seen from the current execution context\n" - "as opposed to the pid, ppid and tid which are kernel internal data structures.\n\n"); - fprintf(ofp, "Example:\n"); - fprintf(ofp, "This command will add the context information 'prio' and two per-cpu\n" - "perf counters (hardware branch misses and cache misses), to all channels\n" - "in the trace data output:\n"); - fprintf(ofp, "# lttng add-context -k -t prio -t perf:cpu:branch-misses -t perf:cpu:cache-misses\n"); - fprintf(ofp, "\n"); -} - /* * Find context numerical value from string. * @@ -647,11 +605,11 @@ static int add_context(char *session_name) } else { if (opt_channel_name) { MSG("%s context %s added to channel %s", - opt_kernel ? "kernel" : "UST", type->opt->symbol, + get_domain_str(dom.type), type->opt->symbol, opt_channel_name); } else { MSG("%s context %s added to all channels", - opt_kernel ? "kernel" : "UST", type->opt->symbol) + get_domain_str(dom.type), type->opt->symbol); } success = 1; } @@ -830,7 +788,6 @@ int cmd_add_context(int argc, const char **argv) char *session_name = NULL; if (argc < 2) { - usage(stderr); ret = CMD_ERROR; goto end; } @@ -870,7 +827,6 @@ int cmd_add_context(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -885,7 +841,6 @@ int cmd_add_context(int argc, const char **argv) if (!opt_type) { ERR("Missing mandatory -t TYPE"); - usage(stderr); ret = CMD_ERROR; goto end; }