Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2021 20:47:48 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c4473add1d3d - main - pmcstat: fix the usage message for -t
Message-ID:  <202104212047.13LKlmdq042506@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=c4473add1d3d588d8747cab86796d2f2d4c8847c

commit c4473add1d3d588d8747cab86796d2f2d4c8847c
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2021-04-21 20:44:52 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2021-04-21 20:44:52 +0000

    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
---
 usr.sbin/pmcstat/pmcstat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104212047.13LKlmdq042506>