X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fmain.c;h=e7c5b6c52d28dfcd1fa80fdf925c8d5317f45b27;hp=5f72c32a906f700ec14009766d056ead3e49b375;hb=a8b66566890a353cc3a89836281541195ad69d73;hpb=a70ac2f49aa47a30abc2b50ec57b582eab4b1028 diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 5f72c32a9..e7c5b6c52 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -98,6 +98,7 @@ enum relay_connection_status { /* command line options */ char *opt_output_path, *opt_working_directory; static int opt_daemon, opt_background, opt_print_version; +enum relay_group_output_by opt_group_output_by = RELAYD_GROUP_OUTPUT_BY_UNKNOWN; /* * We need to wait for listener and live listener threads, as well as @@ -185,6 +186,8 @@ static struct option long_options[] = { { "config", 1, 0, 'f' }, { "version", 0, 0, 'V' }, { "working-directory", 1, 0, 'w', }, + { "group-output-by-session", 0, 0, 's', }, + { "group-output-by-host", 0, 0, 'p', }, { NULL, 0, 0, 0, }, }; @@ -337,6 +340,20 @@ static int set_option(int opt, const char *arg, const char *optname) } } break; + case 's': + if (opt_group_output_by != RELAYD_GROUP_OUTPUT_BY_UNKNOWN) { + ERR("Cannot set --group-output-by-session, another --group-output-by argument is present"); + exit(EXIT_FAILURE); + } + opt_group_output_by = RELAYD_GROUP_OUTPUT_BY_SESSION; + break; + case 'p': + if (opt_group_output_by != RELAYD_GROUP_OUTPUT_BY_UNKNOWN) { + ERR("Cannot set --group-output-by-host, another --group-output-by argument is present"); + exit(EXIT_FAILURE); + } + opt_group_output_by = RELAYD_GROUP_OUTPUT_BY_HOST; + break; default: /* Unknown option or other error. * Error is printed by getopt, just return */ @@ -541,6 +558,10 @@ static int set_options(int argc, char **argv) } } + if (opt_group_output_by == RELAYD_GROUP_OUTPUT_BY_UNKNOWN) { + opt_group_output_by = RELAYD_GROUP_OUTPUT_BY_HOST; + } + exit: free(optstring); return retval;