aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2021-04-21 20:44:52 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2021-04-21 20:44:52 +0000
commitc4473add1d3d588d8747cab86796d2f2d4c8847c (patch)
tree7201e759fe979bea6cf2704aae056bdfa5b1a465
parentedcf9e59c356525632dd2546d72916aeca609a2b (diff)
downloadsrc-c4473add1d3d588d8747cab86796d2f2d4c8847c.tar.gz
src-c4473add1d3d588d8747cab86796d2f2d4c8847c.zip
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
-rw-r--r--usr.sbin/pmcstat/pmcstat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index b7f6c5e0f63e..997005cec269 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -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."