From owner-svn-src-head@FreeBSD.ORG Sat Nov 26 17:48:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3814106566C; Sat, 26 Nov 2011 17:48:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 685B08FC0A; Sat, 26 Nov 2011 17:48:13 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAQHm9bN047440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Nov 2011 19:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAQHm95Y061450; Sat, 26 Nov 2011 19:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAQHm99M061449; Sat, 26 Nov 2011 19:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Nov 2011 19:48:09 +0200 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20111126174808.GK50300@deviant.kiev.zoral.com.ua> References: <201111230734.pAN7YA78032998@svn.freebsd.org> <86ipmaq9i4.fsf@in138.ua3> <86vcq6n8bu.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xrgBBsHnjfjm6j0J" Content-Disposition: inline In-Reply-To: <86vcq6n8bu.fsf@kopusha.home.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 26 Nov 2011 17:48:14 -0000 --xrgBBsHnjfjm6j0J Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 26, 2011 at 06:43:01PM +0200, Mikolaj Golub wrote: >=20 > On Thu, 24 Nov 2011 09:12:35 +0200 Mikolaj Golub wrote: >=20 > MG> On Wed, 23 Nov 2011 11:10:47 -0800 mdf@FreeBSD.org wrote: >=20 > >>> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Aprintf(" AT_IGNORE=3D= 0x%lu", > >>> - =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A (unsigned long= )aux->a_un.a_val); > >>> + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A (unsigned long= )auxv[i].a_un.a_val); >=20 > m>> I didn't see this before, but this gives very misleading output. The > m>> 0x prefix implies the output will be hex, but it's printed as decima= l, > m>> here and below. >=20 > MG> Oh. Thanks! Will fix. >=20 > m>> I don't know if there's a style preference for 0x%lx versus %#lx, > m>> though, or a preference for a different type for the print (uintmax_= t, > m>> for example). There is probably a preference for using u_long rather > m>> than unsigned long, since it's shorter. >=20 > MG> It looks like both 0x%lx and %#lx are widely spread in our source, I= like %#lx > MG> a little more. It looks for me that (u_long) will be ok for now, so = the chage > MG> for the printf above would be: >=20 > MG> printf(" AT_IGNORE=3D%#lx", (u_long)auxv[i].a_un.a_val); >=20 > MG> Anyway, printing all values in the same format was considered by me = as a > MG> temporary solution. I am going to have format depending on a_type, s= o e.g. > MG> AT_PAGESZ will be 4096, not 0x1000. >=20 > MG> Also, now they are printed as one string for a process: >=20 > MG> PID COMM AUXV > MG> 2520 firefox-bin AT_PHDR=3D0x400040 AT_PHENT=3D0x38 AT_PHNUM= =3D0x7 AT_PAGESZ=3D0x1000 ... >=20 > MG> I am considering changing this too, to something like below: >=20 > MG> PID COMM AUXV VALUE > MG> 2520 firefox-bin AT_PHDR 0x400040 > MG> 2520 firefox-bin AT_PHENT 56 > MG> 2520 firefox-bin AT_PHNUM 7 > MG> ... >=20 > I am going to commit this patch if nobody has any other suggestions. >=20 > The typical output: >=20 > in138:~% procstat -x 2008 > PID COMM AUXV VALUE =20 > 2008 nginx AT_PHDR 0x400040 > 2008 nginx AT_PHENT 56 > 2008 nginx AT_PHNUM 8 > 2008 nginx AT_PAGESZ 4096 > 2008 nginx AT_FLAGS 0 > 2008 nginx AT_ENTRY 0x40de00 > 2008 nginx AT_BASE 0x800689000 > 2008 nginx AT_EXECPATH 0x7fffffffefca > 2008 nginx AT_OSRELDATE 1000001 > 2008 nginx AT_CANARY 0x7fffffffef8a > 2008 nginx AT_CANARYLEN 64 > 2008 nginx AT_NCPUS 2 > 2008 nginx AT_PAGESIZES 0x7fffffffef72 > 2008 nginx AT_PAGESIZESLEN 24 > 2008 nginx AT_STACKPROT VM_PROT_ALL I like this output much better. The only thing I am unsure of is the pretty-printing of AT_STACKPROT. Might be, change it to EXECUTABLE/NONEXECUTABLE printout. --xrgBBsHnjfjm6j0J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7RJlgACgkQC3+MBN1Mb4jG9gCfRyJ3b8bqX3aCVCkv+tFJ9d4z L1IAnjxRsxeFT8FwxSJjGcBBT/s6e7kK =aB77 -----END PGP SIGNATURE----- --xrgBBsHnjfjm6j0J--