diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2021-04-21 20:44:52 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2021-04-29 13:21:19 +0000 |
commit | d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 (patch) | |
tree | e0e28d06f76deb2d7bd100ccb09746bc41dce06d | |
parent | 112e30301846d8fede4679a3f95e18820d721bbd (diff) | |
download | src-d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0.tar.gz src-d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0.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
(cherry picked from commit c4473add1d3d588d8747cab86796d2f2d4c8847c)
-rw-r--r-- | usr.sbin/pmcstat/pmcstat.c | 3 |
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." |