From owner-svn-src-all@FreeBSD.ORG Fri Aug 29 17:23:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 254DF386; Fri, 29 Aug 2014 17:23:17 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ECC31AF8; Fri, 29 Aug 2014 17:23:16 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s7THNBvx022344 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 29 Aug 2014 20:23:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s7THNBvx022344 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s7THNBPn022343; Fri, 29 Aug 2014 20:23:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 29 Aug 2014 20:23:11 +0300 From: Konstantin Belousov To: Bryan Drewery Subject: Re: svn commit: r270803 - head/libexec/rtld-elf Message-ID: <20140829172311.GP2737@kib.kiev.ua> References: <201408291044.s7TAiwmI077897@svn.freebsd.org> <540094DB.5050307@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ySXqf0m0EduKBqw5" Content-Disposition: inline In-Reply-To: <540094DB.5050307@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2014 17:23:17 -0000 --ySXqf0m0EduKBqw5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 29, 2014 at 09:57:31AM -0500, Bryan Drewery wrote: > On 8/29/2014 5:44 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Aug 29 10:44:58 2014 > > New Revision: 270803 > > URL: http://svnweb.freebsd.org/changeset/base/270803 > >=20 > > Log: > > Document the whole settings needed to build a debug version of rtld. > > =20 > > Sponsored by: The FreeBSD Foundation > > MFC after: 3 days > >=20 > > Modified: > > head/libexec/rtld-elf/Makefile > >=20 > > Modified: head/libexec/rtld-elf/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/libexec/rtld-elf/Makefile Fri Aug 29 10:43:56 2014 (r270802) > > +++ head/libexec/rtld-elf/Makefile Fri Aug 29 10:44:58 2014 (r270803) > > @@ -1,5 +1,9 @@ > > # $FreeBSD$ > > =20 > > +# Use the following command to build local debug version of dynamic > > +# linker: > > +# make DEBUG_FLAGS=3D-g DEBUG=3D-DDEBUG MK_TESTS=3Dno all > > + > > .include > > MK_SSP=3D no > > =20 > >=20 >=20 > How difficult would it be to allow DEBUG to be set during runtime like > GNU's can with LD_DEBUG? I have found GNU's LD_DEBUG to be very useful > for userland debugging, especially when using dlopen(3). >=20 > We have LD_DEBUG environment variable but it only prints if built with > -DDEBUG. >=20 > Is there a concern about performance by enabling this based only on > environment? I am sure that nobody evaluated the performance consequences of unconditionally compiling the debugging stuff in. I am sure that the ld-elf.so.1 size will increase. The reason why nobody cares to evaluate and enable this stuff by default is that the debugging output is very ad-hoc. I found it almost useless in both the content and amount of data it outputs. The reason why I enable it for my work on ld-elf is that I insert my own dbg() calls for debugging (and usually remove them before the commit since they add even more verbosity useless for general public consumption). I find the combination of the ELF dumping tools like readelf and objdump, together with gdb (-g) and custom dbg() statement (slighly glorified printf debugging) most adequate combination to debug rtld. After the long preamble. What use do you have for LD_DEBUG ? If it is possible to formalize and tailor the debugging output for real users needs, I am all for making it available unconditionally from LD_DEBUG knob. The significants part of the current dbg() statements would be removed or require more agressive settings to become active. --ySXqf0m0EduKBqw5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUALb+AAoJEJDCuSvBvK1BC4EP/3/LubvaSkjSokh9C/AiHNNG 8FtJdYCCWbxBRh+DpLu2lA6OKHAC6WcEUIeACIo1tPIF2fAvFpyL+sNaAqh5RYxZ BpN6HBRy1BA1AjqdRw0nWc2aTIUmyOCLZYbKvarlytNTNtD3un2+yN6ImQBWR2W3 V8Q9xb0ujzwD6JhrzJ2IDXkxUA3n5eSY4N6m1nycSJJI7E/Fh+VIwFRCddPTQP4M KNii+XjH7HtwMDUUXjmMyeVSDOCYe2TkjBms332dS9PGuqTutmxWBp6sjakFraqm uZX2xKaCmiuMm2pY/bK5m7Q/I9+5nnVpYiiyFOlizFLU5niM5EFgK/+yhG1VFi9N +JXVn3+Sw9tnDSOwtNMl3ze3UbvmHJvH969ygb/ge1XQZnJwaHkfl1ud0wCBOElX QLc6s2xPtX5eHOfP5y7CJrwsqEMffmR2COtmcoQvgqk7LebQLi8T+ekAbtVXxg2z a0oLD/UI65cv388EwKh2AGrMTiNkjUIAx21TbetK3MPTZ3e7/PejyIYhyG6uKYGi dA9zKv+bciGQnLWG97kLOyKMju7ZiDGxKuMvfvMxlgqTuLJIMUNo0YuB45QBvvtB Uk7EDGDwsV379ERXcbzBJG4+Yhq4lvleW3Zl/nYMePLPa7jEUHyg7+vYGI991fuw kcNQiI8mswAdRd+mx1ck =lPk6 -----END PGP SIGNATURE----- --ySXqf0m0EduKBqw5--