* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <ctype.h>
#include <popt.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <assert.h>
#include <urcu/list.h>
} else if (opt_userspace) {
dom.type = LTTNG_DOMAIN_UST;
} else {
- print_missing_domain();
- ret = CMD_ERROR;
- goto end;
+ /* Checked by the caller. */
+ assert(0);
}
ret = parse_pid_string(pid_string, all, &pid_list, &nr_pids);
}
}
- if (!(opt_userspace ^ opt_kernel)) {
- ERR("Exactly one of -u or -k needs to be specified.");
- usage(stderr, cmd_str);
- command_ret = CMD_ERROR;
+ ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace);
+ if (ret) {
+ ret = CMD_ERROR;
goto end;
}