pmcstat: fix the usage message for -t

A slight mix-up of the flags means this case isn't triggered when it
should be. Now, `pmcstat -s event -t 1234` will print the correct
error message.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mitchell Horne 2021-04-21 17:44:52 -03:00
parent edcf9e59c3
commit c4473add1d

View File

@ -898,7 +898,8 @@ main(int argc, char **argv)
pmcstat_show_usage();
/* check for -t pid without a process PMC spec */
if ((args.pa_required & FLAG_HAS_TARGET) &&
if ((args.pa_flags & FLAG_HAS_TARGET) &&
(args.pa_required & FLAG_HAS_PROCESS_PMCS) &&
(args.pa_flags & FLAG_HAS_PROCESS_PMCS) == 0)
errx(EX_USAGE,
"ERROR: option -t requires a process mode PMC to be specified."