From owner-dev-commits-src-branches@freebsd.org Thu Apr 29 13:39:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 245BD628C01; Thu, 29 Apr 2021 13:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWGnM6T10z4fyg; Thu, 29 Apr 2021 13:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B70611CA4B; Thu, 29 Apr 2021 13:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13TDdJe1070823; Thu, 29 Apr 2021 13:39:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TDdJ1x070822; Thu, 29 Apr 2021 13:39:19 GMT (envelope-from git) Date: Thu, 29 Apr 2021 13:39:19 GMT Message-Id: <202104291339.13TDdJ1x070822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d87ee7b97fe8 - stable/13 - pmcstat: fix the usage message for -t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:39:20 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 commit d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 Author: Mitchell Horne AuthorDate: 2021-04-21 20:44:52 +0000 Commit: Mitchell Horne CommitDate: 2021-04-29 13:21:19 +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 (cherry picked from commit c4473add1d3d588d8747cab86796d2f2d4c8847c) --- 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."