From owner-svn-src-head@freebsd.org Tue Nov 14 20:00:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B892DDC55B; Tue, 14 Nov 2017 20:00:09 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 365046D195; Tue, 14 Nov 2017 20:00:08 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id BA3725A9F27; Tue, 14 Nov 2017 20:00:02 +0000 (UTC) Date: Tue, 14 Nov 2017 20:00:02 +0000 From: Brooks Davis To: Andriy Gapon Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kdrakehp@zoho.com Subject: Re: svn commit: r324619 - in head/usr.bin/procstat: . tests Message-ID: <20171114200002.GC88203@spindle.one-eyed-alien.net> References: <201710141838.v9EIcaOQ047300@repo.freebsd.org> <81c30f82-268e-ce59-4326-5a2f14ca62e5@FreeBSD.org> <20171113020016.GF76223@spindle.one-eyed-alien.net> <65f847b0-b730-ee35-ca74-2a77cecde9a3@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eJnRUKwClWJh1Khz" Content-Disposition: inline In-Reply-To: <65f847b0-b730-ee35-ca74-2a77cecde9a3@FreeBSD.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2017 20:00:09 -0000 --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 13, 2017 at 09:38:09AM +0200, Andriy Gapon wrote: > On 13/11/2017 04:00, Brooks Davis wrote: > > On Sun, Nov 12, 2017 at 12:15:35PM +0200, Andriy Gapon wrote: > >> On 14/10/2017 21:38, Brooks Davis wrote: > >>> Author: brooks > >>> Date: Sat Oct 14 18:38:36 2017 > >>> New Revision: 324619 > >>> URL: https://svnweb.freebsd.org/changeset/base/324619 > >>> > >>> Log: > >>> Switch procstat from subcommand flags to verbs > >>> =20 > >>> - Use an enumerated value instead of separate flags for commands > >>> - Look for a verb if no command flag is set > >>> - Lookup the "xocontainer" value based on the command > >>> - Document the new command verbs in the man-page > >>> =20 > >>> Submitted by: kdrakehp@zoho.com > >>> Differential Revision: https://reviews.freebsd.org/D10916 > >> > >> What's the new way of doing procstat -kk -a ? > >> > >> procstat -kk -a now crashes because cmd is NULL when 'k' option is pro= cessed. > >> procstat kstack and procstat kstack -v just produce the usage message = without > >> telling any specific usage error. > >> procstat kstack -a says that 'a' is an illegal option. > >=20 > > From the reading the manpage it should be: procstat -a kstack -v >=20 > This works, thank you. >=20 > > The crash is a regression. Please file a bugreport. >=20 > This one line patch seems to fix the crash and procstat -kk -a is usable = again. > Does it look okay to you? >=20 > --- a/usr.bin/procstat/procstat.c > +++ b/usr.bin/procstat/procstat.c > @@ -296,7 +296,7 @@ main(int argc, char *argv[]) > cmd =3D getcmd("tsignals"); > break; > case 'k': > - if (cmd->cmd =3D=3D procstat_kstack) { > + if (cmd !=3D NULL && cmd->cmd =3D=3D procstat_kstack) { > if ((procstat_opts & PS_OPT_VERBOSE) !=3D 0) > usage(); > procstat_opts |=3D PS_OPT_VERBOSE; Looks good to me. -- Brooks --eJnRUKwClWJh1Khz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaC0tCAAoJEKzQXbSebgfAMkcH/3H7rFdP75qP2rOrxq8iHqxM erHpMBbMq9hu+XllYd9UwB7a7n9QqZiIOSUif8dG8bOJHROMKB0x8NbnfEnA/eWv O3dDw5QF0ulU/DTljBgUpMa3I8JLUd17OT71qOefZXXzwlIdywMFki88bFtOUsD5 oQ+i3KLAhChI/eXqPX8jdf3kmgDvr34fCSY/74PQd4G6bwrHWVwu4DTbrFssIOzx ttwopghOCqE7BT3M+yoOc5iHpkZhyPFdwPbMNIFE3lgBDVyjjHrk3Av4yFrwmciB dHfwzc+1wPzx1BXmC/y8Hf9VA+dtv3SgvZjR/QViXn94ZckAECq3dkz8/Ezh2KQ= =oOUM -----END PGP SIGNATURE----- --eJnRUKwClWJh1Khz--