From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18064 invoked by alias); 14 Nov 2014 16:33:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 18052 invoked by uid 89); 14 Nov 2014 16:33:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Nov 2014 16:32:58 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XpJnp-0007LH-Jp from Thomas_Schwinge@mentor.com ; Fri, 14 Nov 2014 08:32:53 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.181.6; Fri, 14 Nov 2014 16:32:52 +0000 From: Thomas Schwinge To: Jakub Jelinek , Julian Brown CC: , Ilya Verbin Subject: GOMP_DEBUG environment variable? (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) In-Reply-To: <20141112100626.GP5026@tucnak.redhat.com> References: <20140923191931.2177e60f@octopus> <20141111135323.29e0f27b@octopus> <20141112100626.GP5026@tucnak.redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Fri, 14 Nov 2014 16:38:00 -0000 Message-ID: <87oas9bv4j.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2014-11/txt/msg01802.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1835 Hi! On Wed, 12 Nov 2014 11:06:26 +0100, Jakub Jelinek wrote: > On Tue, Nov 11, 2014 at 01:53:23PM +0000, Julian Brown wrote: > > @@ -1181,6 +1197,7 @@ initialize_env (void) > > gomp_global_icv.thread_limit_var > > =3D thread_limit_var > INT_MAX ? UINT_MAX : thread_limit_var; > > } > > + parse_int ("GCC_ACC_NOTIFY", &goacc_notify_var, true); >=20 > I would have expected GACC_NOTIFY name instead (or GOACC_NOTIFY) > to match GOMP_SPINCOUNT and similar env vars. GOACC_NOTIFY was a first implementation for an immediate need, but I've always had in the back of my head the idea to generalize this. How about GOMP_DEBUG, and this can then be set to comma-separated list of "classes" of debugging information? > > + gomp_notify ("%s: mapnum=3D%zd, hostaddrs=3D%p, sizes=3D%p, kinds=3D= %p\n", > > + __FUNCTION__, mapnum, hostaddrs, sizes, kinds); >=20 > Isn't such debugging too costly? Perhaps either enable it only in > debugging builds, or at least guard with (perhaps in a gomp_notify macro) > with > if (__builtin_expect (goacc_notify_var, 0)) > (gomp_notify) (__VA_ARGS__) > ? I'd think doing it in debugging builds only should be sufficient. I think, users may occasionally wish to see such "debugging" information, but certainly, guarding it with __builtin_expect is a good thing to do. How about having an enum gomp_debug, defining several "classes" of debugging information ("device" (scanning), "mem" (mapping setup), "offload" (kernel launches), and so on -- not all to be added right now, of course), and make that the first parameter to gomp_debug? Certainly that can't be in "hot" code paths (too much output), and for "non-hot" code paths, I don't think the gomp_debug_var comparison matters, compared to the other code executing nearby. Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUZi6sAAoJEK3/DN1sMFFtEnEH/2kL+qtY6SbU9r2S0gmALSbl ySQQehEcT3PGV/LtUMmtXs2JNALd7N7S+7UxMOj0ww/1xHpqIUxG3CFL1aZwKQOG WOdGbS00mHp7AIJDnFfjRHRufM3eR39XTN2u4LGCAVA9BA7LA3VKlxSB73Nuik+j OxkvJk40v167vqVBvWWp4gx2yPqeGKrlJEtQd+nmkpnFRHsE2kY/li3AiE90c1sn y1VlNO89iERX5xJImT1TCicj2XPtL+pd+/rlSx8yGpU1+jmERn9WKe5EAoBtJm2S AHPHMkZSfjyJ81puGOli1coXbfoq6jhTCQFvlLFGb87cpQBNNoPQ6u01eP5cSy8= =vUYs -----END PGP SIGNATURE----- --=-=-=--