From owner-freebsd-toolchain@FreeBSD.ORG Mon Jan 17 18:44:12 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 760A0106566C for ; Mon, 17 Jan 2011 18:44:12 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 3FA978FC0C for ; Mon, 17 Jan 2011 18:44:12 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0HIiB9D054581 for ; Mon, 17 Jan 2011 10:44:11 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0HIiB6m054580 for freebsd-toolchain@freebsd.org; Mon, 17 Jan 2011 10:44:11 -0800 (PST) (envelope-from sgk) Date: Mon, 17 Jan 2011 10:44:11 -0800 From: Steve Kargl To: freebsd-toolchain@freebsd.org Message-ID: <20110117184411.GA54556@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 18:44:12 -0000 How does one build an executable for profiling with clang? clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p clang: warning: the clang compiler does not support '-pg' I suppose it will be pointless to ask, but shouldn't clang support one of the most basic gcc compiler options if clang is to replace gcc as the base system compiler? -- Steve From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 14:31:32 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 17A3E10656A3; Tue, 18 Jan 2011 14:31:32 +0000 (UTC) Date: Tue, 18 Jan 2011 14:31:32 +0000 From: Alexander Best To: Steve Kargl Message-ID: <20110118143132.GA13162@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110117184411.GA54556@troutmask.apl.washington.edu> Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 14:31:32 -0000 On Mon Jan 17 11, Steve Kargl wrote: > How does one build an executable for profiling with clang? > > clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > clang: warning: the clang compiler does not support '-pg' > > I suppose it will be pointless to ask, but shouldn't clang > support one of the most basic gcc compiler options if clang > is to replace gcc as the base system compiler? profiling is not yet supported by clang irrc. the same goes for cross-compiling. both features will be introduced in one of the next releases. clang is still missing a few gcc features, however i think that's obvious taking into account that gcc exists way longer than clang. however it's also obvious that in a few years gcc will be completely replaced by clang as main open source C/C++ compiler, since it offers tons of advantages and only very few disadvanteges. cheers. alex > > -- > Steve -- a13x From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 14:32:08 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E5AA106566B for ; Tue, 18 Jan 2011 14:32:08 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF098FC1F for ; Tue, 18 Jan 2011 14:32:07 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0B4509CB0DE; Tue, 18 Jan 2011 15:32:06 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iB2S-w98MBwk; Tue, 18 Jan 2011 15:32:05 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 912099CB0FD; Tue, 18 Jan 2011 15:32:05 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0IEW52a043594; Tue, 18 Jan 2011 15:32:05 +0100 (CET) (envelope-from rdivacky) Date: Tue, 18 Jan 2011 15:32:05 +0100 From: Roman Divacky To: Steve Kargl Message-ID: <20110118143205.GA34216@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110117184411.GA54556@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 14:32:08 -0000 On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > How does one build an executable for profiling with clang? LLVM (and thus clang) does not support GPROF profiling. > clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > clang: warning: the clang compiler does not support '-pg' > > I suppose it will be pointless to ask, but shouldn't clang > support one of the most basic gcc compiler options if clang > is to replace gcc as the base system compiler? is GPROF really needed at this point? we have HWPMC, isnt it sufficient? roman From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 15:19:17 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F14D4106564A for ; Tue, 18 Jan 2011 15:19:17 +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 44BBD8FC0A for ; Tue, 18 Jan 2011 15:19:16 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0IEhDwk070023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Jan 2011 16:43:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0IEhDo1085776; Tue, 18 Jan 2011 16:43:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0IEhDnF085775; Tue, 18 Jan 2011 16:43:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Jan 2011 16:43:13 +0200 From: Kostik Belousov To: Roman Divacky Message-ID: <20110118144313.GO2518@deviant.kiev.zoral.com.ua> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8lT/blNmSiRvUClR" Content-Disposition: inline In-Reply-To: <20110118143205.GA34216@freebsd.org> 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.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-toolchain@freebsd.org, Steve Kargl Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 15:19:18 -0000 --8lT/blNmSiRvUClR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > > How does one build an executable for profiling with clang? > =20 > LLVM (and thus clang) does not support GPROF profiling.=20 >=20 > > clang -o testf -O2 -march=3Dnative -pipe -static -pg -I/usr/local/inclu= de -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/= kargl/work/lib -lm_clang_p > > clang: warning: the clang compiler does not support '-pg' > >=20 > > I suppose it will be pointless to ask, but shouldn't clang > > support one of the most basic gcc compiler options if clang > > is to replace gcc as the base system compiler? >=20 > is GPROF really needed at this point? we have HWPMC, isnt > it sufficient? Hwpmc requires additional work for each new CPU model. Also, hwpmc is not supported even on all Intel or AMD CPUs, esp. older models, and e.g. VIA cores. Not to mention !x86 architectures. --8lT/blNmSiRvUClR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk01pwEACgkQC3+MBN1Mb4jOAQCcDN9NMwDccY3EEPsuvT7VQVlD OlAAoKkqq42q0WR9R31sY2twr8oYqoH/ =lL3s -----END PGP SIGNATURE----- --8lT/blNmSiRvUClR-- From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 16:02:53 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3471D106566C; Tue, 18 Jan 2011 16:02:53 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id EB41B8FC0A; Tue, 18 Jan 2011 16:02:52 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0IG2q97010558; Tue, 18 Jan 2011 08:02:52 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0IG2qjB010554; Tue, 18 Jan 2011 08:02:52 -0800 (PST) (envelope-from sgk) Date: Tue, 18 Jan 2011 08:02:52 -0800 From: Steve Kargl To: Roman Divacky Message-ID: <20110118160252.GA6506@troutmask.apl.washington.edu> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110118143205.GA34216@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 16:02:53 -0000 On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > > How does one build an executable for profiling with clang? > > LLVM (and thus clang) does not support GPROF profiling. > > > clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > > clang: warning: the clang compiler does not support '-pg' > > > > I suppose it will be pointless to ask, but shouldn't clang > > support one of the most basic gcc compiler options if clang > > is to replace gcc as the base system compiler? > > is GPROF really needed at this point? we have HWPMC, isnt > it sufficient? > Well, I have not found a suitable command or commands to replace cc -o testf -O2 -march=native -pipe -static -pg testf.c -lm_p ./testf -s -n 10 10000000 expf calls in 1.846954 seconds. gprof -b -l ./testf testf.gmon | head -15 |tail -10 granularity: each sample hit covers 4 byte(s) for 0.01% of 1.84 seconds % cumulative self self total time seconds seconds calls ms/call ms/call name 55.8 1.03 1.03 0 100.00% _mcount [1] 22.9 1.45 0.42 10000000 0.00 0.00 t_expf [4] 12.9 1.68 0.24 1 236.65 709.57 main [2] 5.6 1.79 0.10 0 100.00% .mcount (29) 2.8 1.84 0.05 10000000 0.00 0.00 __fpclassifyf [5] 0.0 1.84 0.00 6 0.00 0.00 memchr [6] 0.0 1.84 0.00 6 0.00 0.00 memcpy [7] Not to mention, one needs to compile a kernel with hwpmc included whereas gprof does not require a special kernel device driver. -- Steve From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 17:17:00 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB221106566B for ; Tue, 18 Jan 2011 17:17:00 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 650378FC12 for ; Tue, 18 Jan 2011 17:16:59 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9602A9CB0C6; Tue, 18 Jan 2011 18:16:58 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CQYMZiL3TEn7; Tue, 18 Jan 2011 18:16:57 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 8AC539CB0FD; Tue, 18 Jan 2011 18:16:57 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0IHGvkx070068; Tue, 18 Jan 2011 18:16:57 +0100 (CET) (envelope-from rdivacky) Date: Tue, 18 Jan 2011 18:16:57 +0100 From: Roman Divacky To: Kostik Belousov Message-ID: <20110118171657.GA68321@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110118144313.GO2518@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org, Steve Kargl Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:17:00 -0000 On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: > On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > > On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > > > How does one build an executable for profiling with clang? > > > > LLVM (and thus clang) does not support GPROF profiling. > > > > > clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > > > clang: warning: the clang compiler does not support '-pg' > > > > > > I suppose it will be pointless to ask, but shouldn't clang > > > support one of the most basic gcc compiler options if clang > > > is to replace gcc as the base system compiler? > > > > is GPROF really needed at this point? we have HWPMC, isnt > > it sufficient? > Hwpmc requires additional work for each new CPU model. Also, > hwpmc is not supported even on all Intel or AMD CPUs, esp. older > models, and e.g. VIA cores. > > Not to mention !x86 architectures. yes. I agree. HWPMC is not 100% solution. for those interested in profiling in LLVM in detail: http://llvm.org/pubs/2010-04-NeustifterProfiling.html summary: LLVM supports inserting profiling probes (but the selection of places where to put them is very naive) but there's no "GPROF writer". I mailed the author of the thesis yesterday and it looks like his work may get committed to upstream LLVM. roman From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 17:35:18 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1691065695; Tue, 18 Jan 2011 17:35:18 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id DED008FC16; Tue, 18 Jan 2011 17:35:17 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0IHZHMC091982; Tue, 18 Jan 2011 09:35:17 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0IHZHVu091981; Tue, 18 Jan 2011 09:35:17 -0800 (PST) (envelope-from sgk) Date: Tue, 18 Jan 2011 09:35:17 -0800 From: Steve Kargl To: Roman Divacky Message-ID: <20110118173517.GA60201@troutmask.apl.washington.edu> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> <20110118171657.GA68321@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110118171657.GA68321@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 17:35:18 -0000 On Tue, Jan 18, 2011 at 06:16:57PM +0100, Roman Divacky wrote: > On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: > > On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > > > On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > > > > How does one build an executable for profiling with clang? > > > > > > LLVM (and thus clang) does not support GPROF profiling. > > > > > > > clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > > > > clang: warning: the clang compiler does not support '-pg' > > > > > > > > I suppose it will be pointless to ask, but shouldn't clang > > > > support one of the most basic gcc compiler options if clang > > > > is to replace gcc as the base system compiler? > > > > > > is GPROF really needed at this point? we have HWPMC, isnt > > > it sufficient? > > Hwpmc requires additional work for each new CPU model. Also, > > hwpmc is not supported even on all Intel or AMD CPUs, esp. older > > models, and e.g. VIA cores. > > > > Not to mention !x86 architectures. > > yes. I agree. HWPMC is not 100% solution. > > for those interested in profiling in LLVM in detail: > > http://llvm.org/pubs/2010-04-NeustifterProfiling.html > > summary: LLVM supports inserting profiling probes (but the selection > of places where to put them is very naive) but there's no > "GPROF writer". > > I mailed the author of the thesis yesterday and it looks like his work may > get committed to upstream LLVM. > Thanks for the url and checking on the status of profiling with llvm. -- Steve From owner-freebsd-toolchain@FreeBSD.ORG Tue Jan 18 21:12:03 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D881A106567A for ; Tue, 18 Jan 2011 21:12:03 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 91A278FC1D for ; Tue, 18 Jan 2011 21:12:02 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B667E9CB057; Tue, 18 Jan 2011 22:12:01 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vv33evHmROm9; Tue, 18 Jan 2011 22:12:00 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id BFBEA9CB452; Tue, 18 Jan 2011 22:12:00 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0ILC08B004457; Tue, 18 Jan 2011 22:12:00 +0100 (CET) (envelope-from rdivacky) Date: Tue, 18 Jan 2011 22:12:00 +0100 From: Roman Divacky To: Steve Kargl Message-ID: <20110118211200.GA3586@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> <20110118171657.GA68321@freebsd.org> <20110118173517.GA60201@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110118173517.GA60201@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 21:12:04 -0000 On Tue, Jan 18, 2011 at 09:35:17AM -0800, Steve Kargl wrote: > On Tue, Jan 18, 2011 at 06:16:57PM +0100, Roman Divacky wrote: > > On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: > > > On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > > > > On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > > > > > How does one build an executable for profiling with clang? > > > > > > > > LLVM (and thus clang) does not support GPROF profiling. > > > > > > > > > clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > > > > > clang: warning: the clang compiler does not support '-pg' > > > > > > > > > > I suppose it will be pointless to ask, but shouldn't clang > > > > > support one of the most basic gcc compiler options if clang > > > > > is to replace gcc as the base system compiler? > > > > > > > > is GPROF really needed at this point? we have HWPMC, isnt > > > > it sufficient? > > > Hwpmc requires additional work for each new CPU model. Also, > > > hwpmc is not supported even on all Intel or AMD CPUs, esp. older > > > models, and e.g. VIA cores. > > > > > > Not to mention !x86 architectures. > > > > yes. I agree. HWPMC is not 100% solution. > > > > for those interested in profiling in LLVM in detail: > > > > http://llvm.org/pubs/2010-04-NeustifterProfiling.html > > > > summary: LLVM supports inserting profiling probes (but the selection > > of places where to put them is very naive) but there's no > > "GPROF writer". > > > > I mailed the author of the thesis yesterday and it looks like his work may > > get committed to upstream LLVM. > > > > Thanks for the url and checking on the status of profiling with llvm. I checked the LLVM code instead and here's what I found: LLVM actually supports profiling, in its own format (llvmprof.out). This can only be used for its PGO optimization (BasicBlockPlacement) and is very naive. Theoretically it should be possible to write "llvmprof.out -> a.out.gmon" converter - no idea how feasible it is. I guess it would not be very easy. I believe it can be sufficiently easy to write a "gprof-like dumper" for the llvmprof.out files (if there's not one already) that would print stuff like "foo called X times, bar called Y times". I dont know about the actual measuring of time. I think it's not in the llvmprof.out. roman From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 10:34:02 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D702F106566B; Wed, 19 Jan 2011 10:34:02 +0000 (UTC) (envelope-from hansot@iae.nl) Received: from smtp-vbr2.xs4all.nl (smtp-vbr2.xs4all.nl [194.109.24.22]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5088FC08; Wed, 19 Jan 2011 10:34:01 +0000 (UTC) Received: from merom.hotsoft.nl (beasties.demon.nl [82.161.3.114]) by smtp-vbr2.xs4all.nl (8.13.8/8.13.8) with ESMTP id p0JAIMuh019995; Wed, 19 Jan 2011 11:18:23 +0100 (CET) (envelope-from hansot@iae.nl) Message-ID: <4D36BA6E.5030202@iae.nl> Date: Wed, 19 Jan 2011 11:18:22 +0100 From: Hans Ottevanger User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101212 Thunderbird/3.1.7 MIME-Version: 1.0 To: Roman Divacky References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> <20110118171657.GA68321@freebsd.org> <20110118173517.GA60201@troutmask.apl.washington.edu> <20110118211200.GA3586@freebsd.org> In-Reply-To: <20110118211200.GA3586@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-toolchain@freebsd.org, Steve Kargl Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 10:34:02 -0000 On 01/18/11 22:12, Roman Divacky wrote: > On Tue, Jan 18, 2011 at 09:35:17AM -0800, Steve Kargl wrote: >> On Tue, Jan 18, 2011 at 06:16:57PM +0100, Roman Divacky wrote: >>> On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: >>>> On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: >>>>> On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: >>>>>> How does one build an executable for profiling with clang? >>>>> >>>>> LLVM (and thus clang) does not support GPROF profiling. >>>>> >>>>>> clang -o testf -O2 -march=native -pipe -static -pg -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p >>>>>> clang: warning: the clang compiler does not support '-pg' >>>>>> If you are really desperate to find the hotspots in your program when compiled with clang, you could call clang with -v to find the call to /bin/ld. Then append _p to the appropriate libs if still needed and replace crt1.o by gcrt1.o while calling ld directly. E.g. "/usr/bin/ld" -Bstatic -o testcoll /usr/lib/gcrt1.o /usr/lib/crti.o /usr/lib/crtbegin.o testcoll.o angle.o apsis.o error.o minmax.o qags.o qext.o qk21.o sort.o timint.o zero.o vmol.o -lm_p -lgcc -lgcc_eh -lc_p -lgcc -lgcc_eh -t /usr/lib/crtend.o /usr/lib/crtn.o You will get a profile without the number of calls for the objects compiled with clang, but with the time spent. In my case: granularity: each sample hit covers 4 byte(s) for 0.00% of 6.41 seconds % cumulative self self total time seconds seconds calls ms/call ms/call name 30.3 1.94 1.94 0 100.00% f_timint [2] 20.2 3.24 1.29 0 100.00% _mcount [3] 19.4 4.48 1.24 21900000 0.00 0.00 exp [4] 13.2 5.32 0.85 0 40.51% vmol [1] 7.3 5.79 0.47 0 100.00% f_angle [5] 2.8 5.98 0.18 1000000 0.00 0.00 pow [7] 2.7 6.15 0.17 0 48.70% qk21 [6] 2.4 6.30 0.15 0 100.00% .mcount (51) 0.5 6.33 0.03 0 100.00% zero [8] 0.4 6.35 0.02 0 100.00% qext [9] 0.4 6.38 0.02 0 100.00% qags [10] ... >>>>>> I suppose it will be pointless to ask, but shouldn't clang >>>>>> support one of the most basic gcc compiler options if clang >>>>>> is to replace gcc as the base system compiler? >>>>> >>>>> is GPROF really needed at this point? we have HWPMC, isnt >>>>> it sufficient? >>>> Hwpmc requires additional work for each new CPU model. Also, >>>> hwpmc is not supported even on all Intel or AMD CPUs, esp. older >>>> models, and e.g. VIA cores. >>>> >>>> Not to mention !x86 architectures. >>> >>> yes. I agree. HWPMC is not 100% solution. >>> >>> for those interested in profiling in LLVM in detail: >>> >>> http://llvm.org/pubs/2010-04-NeustifterProfiling.html >>> >>> summary: LLVM supports inserting profiling probes (but the selection >>> of places where to put them is very naive) but there's no >>> "GPROF writer". >>> >>> I mailed the author of the thesis yesterday and it looks like his work may >>> get committed to upstream LLVM. >>> >> >> Thanks for the url and checking on the status of profiling with llvm. > > I checked the LLVM code instead and here's what I found: > > LLVM actually supports profiling, in its own format (llvmprof.out). This can > only be used for its PGO optimization (BasicBlockPlacement) and is very naive. > > Theoretically it should be possible to write "llvmprof.out -> a.out.gmon" > converter - no idea how feasible it is. I guess it would not be very easy. > > I believe it can be sufficiently easy to write a "gprof-like dumper" for > the llvmprof.out files (if there's not one already) that would print > stuff like "foo called X times, bar called Y times". I dont know about > the actual measuring of time. I think it's not in the llvmprof.out. > I have not yet completely read the reference provided, but my impression is that it describes considerably more sophistication than needed to get gprof running with clang (though the thesis looks very interesting!). All gprof needs is statistical profiling as provided by the kernel through profil(2) and addition by the compiler of a call to .mcount (and possibly allocation of a small amount of storage) on entry of each function. gcc (and pcc before it) has done this for more than 20 years, although I must admit that the code generated for the amd64 using -pg is a bit opaque to me (i386 is straightforward, though). The rest of the machinery needed is already there (in lib/libc/gmon and e.g. lib/csu/amd64/crt1.c). Kind regards, Hans Ottevanger From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 10:44:52 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 731AF106566C for ; Wed, 19 Jan 2011 10:44:52 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id CA2398FC1E for ; Wed, 19 Jan 2011 10:44:51 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C62649CB0F4; Wed, 19 Jan 2011 11:44:49 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RntnPe6dNMoz; Wed, 19 Jan 2011 11:44:48 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CA3359CB452; Wed, 19 Jan 2011 11:44:48 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0JAimWg016120; Wed, 19 Jan 2011 11:44:48 +0100 (CET) (envelope-from rdivacky) Date: Wed, 19 Jan 2011 11:44:48 +0100 From: Roman Divacky To: Hans Ottevanger Message-ID: <20110119104448.GA15730@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> <20110118171657.GA68321@freebsd.org> <20110118173517.GA60201@troutmask.apl.washington.edu> <20110118211200.GA3586@freebsd.org> <4D36BA6E.5030202@iae.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D36BA6E.5030202@iae.nl> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org, Steve Kargl Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 10:44:52 -0000 On Wed, Jan 19, 2011 at 11:18:22AM +0100, Hans Ottevanger wrote: > On 01/18/11 22:12, Roman Divacky wrote: > >On Tue, Jan 18, 2011 at 09:35:17AM -0800, Steve Kargl wrote: > >>On Tue, Jan 18, 2011 at 06:16:57PM +0100, Roman Divacky wrote: > >>>On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: > >>>>On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > >>>>>On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > >>>>>>How does one build an executable for profiling with clang? > >>>>> > >>>>>LLVM (and thus clang) does not support GPROF profiling. > >>>>> > >>>>>>clang -o testf -O2 -march=native -pipe -static -pg > >>>>>>-I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk > >>>>>>-lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > >>>>>>clang: warning: the clang compiler does not support '-pg' > >>>>>> > > If you are really desperate to find the hotspots in your program when > compiled with clang, you could call clang with -v to find the call to > /bin/ld. Then append _p to the appropriate libs if still needed and > replace crt1.o by gcrt1.o while calling ld directly. E.g. > > "/usr/bin/ld" -Bstatic -o testcoll /usr/lib/gcrt1.o /usr/lib/crti.o > /usr/lib/crtbegin.o testcoll.o angle.o apsis.o error.o minmax.o qags.o > qext.o qk21.o sort.o timint.o zero.o vmol.o -lm_p -lgcc -lgcc_eh -lc_p > -lgcc -lgcc_eh -t /usr/lib/crtend.o /usr/lib/crtn.o > > You will get a profile without the number of calls for the objects > compiled with clang, but with the time spent. In my case: > > granularity: each sample hit covers 4 byte(s) for 0.00% of 6.41 seconds > > % cumulative self self total > time seconds seconds calls ms/call ms/call name > 30.3 1.94 1.94 0 100.00% f_timint [2] > 20.2 3.24 1.29 0 100.00% _mcount [3] > 19.4 4.48 1.24 21900000 0.00 0.00 exp [4] > 13.2 5.32 0.85 0 40.51% vmol [1] > 7.3 5.79 0.47 0 100.00% f_angle [5] > 2.8 5.98 0.18 1000000 0.00 0.00 pow [7] > 2.7 6.15 0.17 0 48.70% qk21 [6] > 2.4 6.30 0.15 0 100.00% .mcount (51) > 0.5 6.33 0.03 0 100.00% zero [8] > 0.4 6.35 0.02 0 100.00% qext [9] > 0.4 6.38 0.02 0 100.00% qags [10] > ... hm.. this is interesting. I wonder if it makes sense to teach the driver about this (it's a trivial change). opinions? > >>>>>>I suppose it will be pointless to ask, but shouldn't clang > >>>>>>support one of the most basic gcc compiler options if clang > >>>>>>is to replace gcc as the base system compiler? > >>>>> > >>>>>is GPROF really needed at this point? we have HWPMC, isnt > >>>>>it sufficient? > >>>>Hwpmc requires additional work for each new CPU model. Also, > >>>>hwpmc is not supported even on all Intel or AMD CPUs, esp. older > >>>>models, and e.g. VIA cores. > >>>> > >>>>Not to mention !x86 architectures. > >>> > >>>yes. I agree. HWPMC is not 100% solution. > >>> > >>>for those interested in profiling in LLVM in detail: > >>> > >>> http://llvm.org/pubs/2010-04-NeustifterProfiling.html > >>> > >>>summary: LLVM supports inserting profiling probes (but the selection > >>> of places where to put them is very naive) but there's no > >>> "GPROF writer". > >>> > >>>I mailed the author of the thesis yesterday and it looks like his work > >>>may > >>>get committed to upstream LLVM. > >>> > >> > >>Thanks for the url and checking on the status of profiling with llvm. > > > >I checked the LLVM code instead and here's what I found: > > > >LLVM actually supports profiling, in its own format (llvmprof.out). This > >can > >only be used for its PGO optimization (BasicBlockPlacement) and is very > >naive. > > > >Theoretically it should be possible to write "llvmprof.out -> a.out.gmon" > >converter - no idea how feasible it is. I guess it would not be very easy. > > > >I believe it can be sufficiently easy to write a "gprof-like dumper" for > >the llvmprof.out files (if there's not one already) that would print > >stuff like "foo called X times, bar called Y times". I dont know about > >the actual measuring of time. I think it's not in the llvmprof.out. > > > > I have not yet completely read the reference provided, but my impression > is that it describes considerably more sophistication than needed to get > gprof running with clang (though the thesis looks very interesting!). > All gprof needs is statistical profiling as provided by the kernel > through profil(2) and addition by the compiler of a call to .mcount (and > possibly allocation of a small amount of storage) on entry of each > function. gcc (and pcc before it) has done this for more than 20 years, > although I must admit that the code generated for the amd64 using -pg is > a bit opaque to me (i386 is straightforward, though). The rest of the > machinery needed is already there (in lib/libc/gmon and e.g. > lib/csu/amd64/crt1.c). would you be interested in working on adding the necessary stuff to LLVM? if it's really just about placing .mcount calls in profiling points I believe it should be doable.. roman From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 16:40:27 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5069110656A5; Wed, 19 Jan 2011 16:40:27 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4788FC20; Wed, 19 Jan 2011 16:40:27 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0JGeQOd014056; Wed, 19 Jan 2011 08:40:26 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0JGeQlA014055; Wed, 19 Jan 2011 08:40:26 -0800 (PST) (envelope-from sgk) Date: Wed, 19 Jan 2011 08:40:26 -0800 From: Steve Kargl To: Hans Ottevanger Message-ID: <20110119164026.GA13969@troutmask.apl.washington.edu> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> <20110118171657.GA68321@freebsd.org> <20110118173517.GA60201@troutmask.apl.washington.edu> <20110118211200.GA3586@freebsd.org> <4D36BA6E.5030202@iae.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D36BA6E.5030202@iae.nl> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 16:40:27 -0000 On Wed, Jan 19, 2011 at 11:18:22AM +0100, Hans Ottevanger wrote: > On 01/18/11 22:12, Roman Divacky wrote: > >On Tue, Jan 18, 2011 at 09:35:17AM -0800, Steve Kargl wrote: > >>On Tue, Jan 18, 2011 at 06:16:57PM +0100, Roman Divacky wrote: > >>>On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: > >>>>On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > >>>>>On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > >>>>>>How does one build an executable for profiling with clang? > >>>>> > >>>>>LLVM (and thus clang) does not support GPROF profiling. > >>>>> > >>>>>>clang -o testf -O2 -march=native -pipe -static -pg > >>>>>>-I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk > >>>>>>-lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > >>>>>>clang: warning: the clang compiler does not support '-pg' > >>>>>> > > If you are really desperate to find the hotspots in your program when > compiled with clang, you could call clang with -v to find the call to > /bin/ld. Then append _p to the appropriate libs if still needed and > replace crt1.o by gcrt1.o while calling ld directly. E.g. I am working on implementations of missing long double functions and complex function from libm. In doing this work, there are two overriding desires: accuracy and speed. In addition, I want to compare and *profile* a clang built libm against a gcc built libm. I already have anecdotal evidence that a clang libm is usually slower and sometime less accurate than a gcc libm. Thus, the desire to build a clang libm with something equivalent to 'gcc -pg'. > "/usr/bin/ld" -Bstatic -o testcoll /usr/lib/gcrt1.o /usr/lib/crti.o > /usr/lib/crtbegin.o testcoll.o angle.o apsis.o error.o minmax.o qags.o > qext.o qk21.o sort.o timint.o zero.o vmol.o -lm_p -lgcc -lgcc_eh -lc_p > -lgcc -lgcc_eh -t /usr/lib/crtend.o /usr/lib/crtn.o How do I create libm_p.a with clang? That's the issue. -- Steve From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 16:47:53 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECFB6106566C; Wed, 19 Jan 2011 16:47:52 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id CA68C8FC15; Wed, 19 Jan 2011 16:47:52 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0JGlqn9014105; Wed, 19 Jan 2011 08:47:52 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0JGlq6u014104; Wed, 19 Jan 2011 08:47:52 -0800 (PST) (envelope-from sgk) Date: Wed, 19 Jan 2011 08:47:52 -0800 From: Steve Kargl To: Roman Divacky Message-ID: <20110119164752.GB13969@troutmask.apl.washington.edu> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118144313.GO2518@deviant.kiev.zoral.com.ua> <20110118171657.GA68321@freebsd.org> <20110118173517.GA60201@troutmask.apl.washington.edu> <20110118211200.GA3586@freebsd.org> <4D36BA6E.5030202@iae.nl> <20110119104448.GA15730@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110119104448.GA15730@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 16:47:53 -0000 On Wed, Jan 19, 2011 at 11:44:48AM +0100, Roman Divacky wrote: > On Wed, Jan 19, 2011 at 11:18:22AM +0100, Hans Ottevanger wrote: > > On 01/18/11 22:12, Roman Divacky wrote: > > >On Tue, Jan 18, 2011 at 09:35:17AM -0800, Steve Kargl wrote: > > >>On Tue, Jan 18, 2011 at 06:16:57PM +0100, Roman Divacky wrote: > > >>>On Tue, Jan 18, 2011 at 04:43:13PM +0200, Kostik Belousov wrote: > > >>>>On Tue, Jan 18, 2011 at 03:32:05PM +0100, Roman Divacky wrote: > > >>>>>On Mon, Jan 17, 2011 at 10:44:11AM -0800, Steve Kargl wrote: > > >>>>>>How does one build an executable for profiling with clang? > > >>>>> > > >>>>>LLVM (and thus clang) does not support GPROF profiling. > > >>>>> > > >>>>>>clang -o testf -O2 -march=native -pipe -static -pg > > >>>>>>-I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk > > >>>>>>-lmpfr -lgmp -L/usr/home/kargl/work/lib -lm_clang_p > > >>>>>>clang: warning: the clang compiler does not support '-pg' > > >>>>>> > > > > If you are really desperate to find the hotspots in your program when > > compiled with clang, you could call clang with -v to find the call to > > /bin/ld. Then append _p to the appropriate libs if still needed and > > replace crt1.o by gcrt1.o while calling ld directly. E.g. > > > > "/usr/bin/ld" -Bstatic -o testcoll /usr/lib/gcrt1.o /usr/lib/crti.o > > /usr/lib/crtbegin.o testcoll.o angle.o apsis.o error.o minmax.o qags.o > > qext.o qk21.o sort.o timint.o zero.o vmol.o -lm_p -lgcc -lgcc_eh -lc_p > > -lgcc -lgcc_eh -t /usr/lib/crtend.o /usr/lib/crtn.o > > > > You will get a profile without the number of calls for the objects > > compiled with clang, but with the time spent. In my case: > > > > granularity: each sample hit covers 4 byte(s) for 0.00% of 6.41 seconds > > > > % cumulative self self total > > time seconds seconds calls ms/call ms/call name > > 30.3 1.94 1.94 0 100.00% f_timint [2] > > 20.2 3.24 1.29 0 100.00% _mcount [3] > > 19.4 4.48 1.24 21900000 0.00 0.00 exp [4] > > 13.2 5.32 0.85 0 40.51% vmol [1] > > 7.3 5.79 0.47 0 100.00% f_angle [5] > > 2.8 5.98 0.18 1000000 0.00 0.00 pow [7] > > 2.7 6.15 0.17 0 48.70% qk21 [6] > > 2.4 6.30 0.15 0 100.00% .mcount (51) > > 0.5 6.33 0.03 0 100.00% zero [8] > > 0.4 6.35 0.02 0 100.00% qext [9] > > 0.4 6.38 0.02 0 100.00% qags [10] > > ... > > hm.. this is interesting. I wonder if it makes sense to teach the > driver about this (it's a trivial change). opinions? > I believe that this does not address the issue. The issue is how does one create libm_p.c and libc_p.c with clang. -- Steve From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 18:24:14 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6A0A1065679 for ; Wed, 19 Jan 2011 18:24:14 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id 53C7B8FC25 for ; Wed, 19 Jan 2011 18:24:14 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 9AF74F0C08C for ; Wed, 19 Jan 2011 18:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=NWnGS7BlemhChjnPrgN3RUmWLtQ =; b=RwenopFwuZa4XhIIu3A1uCvugc/08dfop8tiXEVDlscm0RscfK2gRAzzY87 5txx1clV60lurbYKirk3OIMFz+8zXoqLKLYwY6tqgY/pOWQM/Dq4k9hceLqnvxxy eaW6H/Fwn4EK7q5WRpkRaQSBcTb3zvMCnUmVxFElwx+hdMzg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=AxmOmm8ICDB121aWii0Lr PUJZPEhAA+w8oJOBUaonJEJbZYNQlcABhL2VFLF6YHXsPLkRgtDpsLgvqmOsxLnM sI3fLpbsRbCbuQt/Meh7WwHDizkLiyCAtfivez9p7qAcFc+DK3P9rxEbVe2hO9pL 60bdd+fmuUl7bNr/lFMHfw= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id 1B424F07034 for ; Wed, 19 Jan 2011 18:08:08 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Wed, 19 Jan 2011 18:08:13 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110119180808.1B424F07034@mail.your.org> X-Mailman-Approved-At: Wed, 19 Jan 2011 18:36:13 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 18:24:14 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBsbHZtLgpGdWxsIGRldGFpbHMgYXJlIGF2YWls YWJsZSBhdDoKIGh0dHA6Ly9sbHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC9idWlsZGVy cy9mcmVlYnNkLWNsYW5nLWFtZDY0L2J1aWxkcy8zOQoKQnVpbGRib3QgVVJMOiBodHRwOi8vbGx2 bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvCgpCdWlsZHNsYXZlIGZvciB0aGlzIEJ1aWxk OiBmcmVlYnNkLWFtZDY0CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2UgU3Rh bXA6IDEyMzgzMwpCbGFtZWxpc3Q6IGRncmVnb3IsbmljaG9sYXMKCkJVSUxEIEZBSUxFRDogZmFp bGVkIGNvbXBpbGUtZnJlZWJzZC1rZXJuZWwKCnNpbmNlcmVseSwKIC1UaGUgQnVpbGRib3QKCg== From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 19:21:45 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C8DA1065673 for ; Wed, 19 Jan 2011 19:21:45 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id D0FDA8FC16 for ; Wed, 19 Jan 2011 19:21:44 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 199B0F0C0C8 for ; Wed, 19 Jan 2011 19:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=ZEe97ajHIkngUyg4VVuMC8/vDRc =; b=An+UVzGcAOPzgrREoyh+aT91b+/ecpL/dl8xuhBE0TLh1UN79380NPCRWdx OO3ZozOi35B6dbPxx2TAr/gPtD3VJdve9s/ckFLG3AsyIEsjmYvJtaOfh/OoRJY4 b7L/HsPQ4lL6qbJvEmNGyfhwdb41G9NR2+hKGuWB3Jb/Q+oA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=0JyU5xjP7ib/4UFUDWvuf AXVlH5Em8Bx9PV8/nrexTgt5EaHDx04GwTi7z0Shs24k0ULqv4YSyNrmjORZJixz 43dUhsSqyixcAXC8+cXr+/McFsauZ6Li+rg50UDJFMvevlnITFalF7JB33p9flBm tzWBtklngWSc3jnPoT3sDc= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id D7F4EF0702D for ; Wed, 19 Jan 2011 19:21:43 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Wed, 19 Jan 2011 19:21:46 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110119192143.D7F4EF0702D@mail.your.org> X-Mailman-Approved-At: Wed, 19 Jan 2011 19:36:10 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-i386 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 19:21:45 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1pMzg2IHdoaWxlIGJ1aWxkaW5nIGxsdm0uCkZ1bGwgZGV0YWlscyBhcmUgYXZhaWxh YmxlIGF0OgogaHR0cDovL2xsdm0tYW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwL2J1aWxkZXJz L2ZyZWVic2QtY2xhbmctaTM4Ni9idWlsZHMvMzUKCkJ1aWxkYm90IFVSTDogaHR0cDovL2xsdm0t YW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwLwoKQnVpbGRzbGF2ZSBmb3IgdGhpcyBCdWlsZDog ZnJlZWJzZC1pMzg2CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2UgU3RhbXA6 IDEyMzgzMwpCbGFtZWxpc3Q6IGRncmVnb3IsbmljaG9sYXMKCkJVSUxEIEZBSUxFRDogZmFpbGVk IGNvbXBpbGUtZnJlZWJzZC1rZXJuZWwKCnNpbmNlcmVseSwKIC1UaGUgQnVpbGRib3QKCg== From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 20:49:40 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B517106564A for ; Wed, 19 Jan 2011 20:49:40 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id E76A68FC12 for ; Wed, 19 Jan 2011 20:49:39 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 59B93F0C0C6 for ; Wed, 19 Jan 2011 20:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=omKj+6so0GS81USmFdP8ETjp6fU =; b=bZiT8wavjSaxlTuxTzLJ0yXCz4IEOO1mvywZWq5s5K9AcUgbBhqv3IRzPRo 8l8Y/eErOiMptPcdkirel4coS8Bt8QU2DlD2cWmY0CaU7HlAEog/CZ9C1ELRuSOX mbkdCUvhbiIG3pPsVDL7HmnH7UazgwJboXpur+7kUsmnc0Nc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=LftPjMSoHuL8p5LuJlGHw ssRHDanQzhHvJb41Ixb2nS/dpsvl84Yqj3EzABym/Zg3eqJweQy7k+i6i5RoSrKY AoDHevZnI8NWlhzUTOFNbEU8SSFG7zvwOqmYSmDDSgGBO9u/iFdFvSgmRaMwk6g2 8QMyJjo/o2seXuvRmtGFtY= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id 34F13F0C0BD for ; Wed, 19 Jan 2011 20:49:39 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Wed, 19 Jan 2011 20:49:42 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110119204939.34F13F0C0BD@mail.your.org> X-Mailman-Approved-At: Wed, 19 Jan 2011 21:20:41 +0000 Subject: buildbot success in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 20:49:40 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIHJlc3RvcmVkIGJ1aWxkIG9uIGJ1aWxkZXIgZnJl ZWJzZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBsbHZtLgpGdWxsIGRldGFpbHMgYXJlIGF2 YWlsYWJsZSBhdDoKIGh0dHA6Ly9sbHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC9idWls ZGVycy9mcmVlYnNkLWNsYW5nLWFtZDY0L2J1aWxkcy80MQoKQnVpbGRib3QgVVJMOiBodHRwOi8v bGx2bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvCgpCdWlsZHNsYXZlIGZvciB0aGlzIEJ1 aWxkOiBmcmVlYnNkLWFtZDY0CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2Ug U3RhbXA6IDEyMzg0MgpCbGFtZWxpc3Q6IG5pY2hvbGFzCgpCdWlsZCBzdWNjZWVkZWQhCgpzaW5j ZXJlbHksCiAtVGhlIEJ1aWxkYm90Cgo= From owner-freebsd-toolchain@FreeBSD.ORG Wed Jan 19 21:17:09 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8D4B106564A for ; Wed, 19 Jan 2011 21:17:09 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id 8040C8FC0C for ; Wed, 19 Jan 2011 21:17:09 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id B3863F0C0CC for ; Wed, 19 Jan 2011 21:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=LSBf2tfYgFi/h9sDXEpyRHnRBFE =; b=AhbzQHnDoaStQSQ+YsxUyRDoE864k0YYOBt1dbPQUn4yrvSMvFiDCusOTxd 0xXwDbM3Zn4qQ6INMxDLmEIh1Gh3Vel+HjUdvJEDb7nEb752zA8+lvP6Ysyzr2At B8QC6mwisIoYXmxcMfG5jhqlIa1TfQJ4ZDmSqlF6s784I+wE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=j8hQ5+KP/QvKJXOiU6mR7 RQLu77TESPC2R2E4kcOvD/ohBcDKcAjUp1KURwajMyDpoB6pdUV8WvFVQeI2Eza+ 5oi5WRVpIw5qYH51acwqTewjLD4sm9QKTcsatlbGACzLDZLgKF7Vj13pdO/0x4/Z JBbCIb9LmDMEiThz7Hj3Pw= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id 838D1F0C0C6 for ; Wed, 19 Jan 2011 21:17:08 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Wed, 19 Jan 2011 21:17:11 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110119211708.838D1F0C0C6@mail.your.org> X-Mailman-Approved-At: Wed, 19 Jan 2011 21:48:44 +0000 Subject: buildbot success in FreeBSD/clang on freebsd-clang-i386 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2011 21:17:09 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIHJlc3RvcmVkIGJ1aWxkIG9uIGJ1aWxkZXIgZnJl ZWJzZC1jbGFuZy1pMzg2IHdoaWxlIGJ1aWxkaW5nIGNsYW5nLgpGdWxsIGRldGFpbHMgYXJlIGF2 YWlsYWJsZSBhdDoKIGh0dHA6Ly9sbHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC9idWls ZGVycy9mcmVlYnNkLWNsYW5nLWkzODYvYnVpbGRzLzM2CgpCdWlsZGJvdCBVUkw6IGh0dHA6Ly9s bHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC8KCkJ1aWxkc2xhdmUgZm9yIHRoaXMgQnVp bGQ6IGZyZWVic2QtaTM4NgoKQnVpbGQgUmVhc29uOiBzY2hlZHVsZXIKQnVpbGQgU291cmNlIFN0 YW1wOiAxMjM4MzkKQmxhbWVsaXN0OiBicnVubyxkZ3JlZ29yLG5pY2hvbGFzLHJhZmFlbAoKQnVp bGQgc3VjY2VlZGVkIQoKc2luY2VyZWx5LAogLVRoZSBCdWlsZGJvdAoK From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 20 18:54:53 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C890E106566B for ; Thu, 20 Jan 2011 18:54:53 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 81A858FC16 for ; Thu, 20 Jan 2011 18:54:52 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4111B9CB0DC; Thu, 20 Jan 2011 19:54:51 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4HM8Ot5JTLAS; Thu, 20 Jan 2011 19:54:50 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 799C19CB153; Thu, 20 Jan 2011 19:54:50 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0KIsnbG093645; Thu, 20 Jan 2011 19:54:49 +0100 (CET) (envelope-from rdivacky) Date: Thu, 20 Jan 2011 19:54:49 +0100 From: Roman Divacky To: Steve Kargl Message-ID: <20110120185449.GA92860@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <20110118160252.GA6506@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 18:54:53 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ok, I sat down and implemented what Hans Ottevanger told me to do :) http://lev.vlakno.cz/~rdivacky/clang-gprof.patch This patch does three things: 1) emits "call .mcount" at the begining of every function body 2) changes the driver to link in gcrt1.o instead of crt1.o 3) changes all -lfoo to -lfoo_p except when the foo ends with _s in the linker invocation I am not sure that I did the right thing, especially in (3). Anyway, the patch works for me (ie. produces a.out.gmon that seems to contain meaningful data). I would appreciate if you guys could test and review this. Letting me know if this is correct. Thank you! roman p.s. the patch is against TRUNK clang but there should not be any/much trouble applying it to contrib/llvm/tools/clang I hope --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk04hPkACgkQLVEj6D3CBExztACeIvoImxMie+vyGF5yTn2W7Szz NF8AnRGWWICgAKOr1QPmHNIzxo6YzeA/ =RYR8 -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8-- From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 20 19:57:47 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070451065675; Thu, 20 Jan 2011 19:57:47 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id C5EAB8FC12; Thu, 20 Jan 2011 19:57:46 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LFC005044O9AN00@smtpauth3.wiscmail.wisc.edu>; Thu, 20 Jan 2011 12:57:45 -0600 (CST) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LFC000ZH4O3GY20@smtpauth3.wiscmail.wisc.edu>; Thu, 20 Jan 2011 12:57:39 -0600 (CST) Date: Thu, 20 Jan 2011 12:57:39 -0600 From: Nathan Whitehorn In-reply-to: <20110120185449.GA92860@freebsd.org> To: Roman Divacky Message-id: <4D3885A3.80407@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-9, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.1.20.185115, SenderIP=128.104.160.176 References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.13) Gecko/20110104 Thunderbird/3.1.7 Cc: freebsd-toolchain@freebsd.org, Steve Kargl Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 19:57:47 -0000 On 01/20/11 12:54, Roman Divacky wrote: > ok, I sat down and implemented what Hans Ottevanger told me to do :) > > http://lev.vlakno.cz/~rdivacky/clang-gprof.patch > > This patch does three things: > > 1) emits "call .mcount" at the begining of every function body It's not always called .mcount. See /sys/$ARCH/include/profile.h -Nathan From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 20 20:11:03 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40303106566C for ; Thu, 20 Jan 2011 20:11:03 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id 16DE08FC14 for ; Thu, 20 Jan 2011 20:11:02 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 3FEE5F0C0B4 for ; Thu, 20 Jan 2011 20:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=QN54m5O0xiNTHX94QQZ3eZSBJAE =; b=E5DdPYUv2QFXVlaZHM0Tjw2mBglXp605WKhnW+u8GqJHIM/clGPwwpUKxFm V3C2lSIfRjiFiCPzwRs+PSY5ftuWeLXiXyuRWVGRFZ+0Wkjx3mQ3QhXvNYTbiIJM CQk6U7u2+Z01GIbbbaiasO+C5GQB2p0n4jnxlsP0gfrq36O8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=MNXSIS+qXZMHx+gzoF8xK n9JZlrYtkEd9Lq4dSlv7BiMFSkTmIqF9aUlOs4Rb/LkkdOZKMMxmgz3hcFaGWvOV Ro1d28D80yZg/CvqOmiWfSDPzlQ9fi7UCts++GJXsMug6u6YcPtEv5QX8J0xJ9vl +RHYJffuhvmR3GgTutkv5k= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id DD628F07029 for ; Thu, 20 Jan 2011 20:11:01 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Thu, 20 Jan 2011 20:11:05 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110120201101.DD628F07029@mail.your.org> X-Mailman-Approved-At: Thu, 20 Jan 2011 20:39:28 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 20:11:03 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBsbHZtLgpGdWxsIGRldGFpbHMgYXJlIGF2YWls YWJsZSBhdDoKIGh0dHA6Ly9sbHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC9idWlsZGVy cy9mcmVlYnNkLWNsYW5nLWFtZDY0L2J1aWxkcy81MAoKQnVpbGRib3QgVVJMOiBodHRwOi8vbGx2 bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvCgpCdWlsZHNsYXZlIGZvciB0aGlzIEJ1aWxk OiBmcmVlYnNkLWFtZDY0CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2UgU3Rh bXA6IDEyMzkzNApCbGFtZWxpc3Q6IGFuZGVyc2NhLGJydW5vLGJ3aWxzb24sZGdyZWdvcixkcGF0 ZWwsZmphaGFuaWFuLGtyYWlza2lsLGtyZW1lbmVrLG1zcGVuY2VyLHJhZmFlbCxzdG9rbHVuZAoK QlVJTEQgRkFJTEVEOiBmYWlsZWQgY29tcGlsZS1mcmVlYnNkLWtlcm5lbAoKc2luY2VyZWx5LAog LVRoZSBCdWlsZGJvdAoK From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 20 21:45:04 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F40ED1065670; Thu, 20 Jan 2011 21:45:03 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id D48748FC24; Thu, 20 Jan 2011 21:45:03 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id p0KLj33u019122; Thu, 20 Jan 2011 13:45:03 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id p0KLj3RH019121; Thu, 20 Jan 2011 13:45:03 -0800 (PST) (envelope-from sgk) Date: Thu, 20 Jan 2011 13:45:03 -0800 From: Steve Kargl To: Roman Divacky Message-ID: <20110120214503.GA19077@troutmask.apl.washington.edu> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110120185449.GA92860@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 21:45:04 -0000 On Thu, Jan 20, 2011 at 07:54:49PM +0100, Roman Divacky wrote: > > ok, I sat down and implemented what Hans Ottevanger told me to do :) > > http://lev.vlakno.cz/~rdivacky/clang-gprof.patch > Wow. Thanks. I tried applying your patch to % svn update At revision 217661. % cd /usr/src/contrib/llvm/tools/clang % patch < /usr/home/kargl/clang-gprof.patch | & tee sgk.log Inspection of sgk.log found |Index: include/clang/Frontend/CodeGenOptions.h |=================================================================== |--- include/clang/Frontend/CodeGenOptions.h (revision 123935) |+++ include/clang/Frontend/CodeGenOptions.h (working copy) -------------------------- Patching file include/clang/Frontend/CodeGenOptions.h using Plan A... Hunk #1 failed at 56. Hunk #2 failed at 126. 2 out of 2 hunks failed--saving rejects to include/clang/Frontend/CodeGenOptions.h.rej |Index: lib/Driver/Tools.cpp |=================================================================== |--- lib/Driver/Tools.cpp (revision 123935) |+++ lib/Driver/Tools.cpp (working copy) -------------------------- Patching file lib/Driver/Tools.cpp using Plan A... Hunk #1 failed at 1280. Hunk #2 succeeded at 1452 (offset -259 lines). Hunk #3 succeeded at 3131 (offset -7 lines). Hunk #4 succeeded at 2967 (offset -245 lines). 1 out of 4 hunks failed--saving rejects to lib/Driver/Tools.cpp.rej I applied the rejected parts by hand (which might be a cause for the problem below). % cd ../../ % svn status ? tools/clang/sgk.log M tools/clang/include/clang/Frontend/CodeGenOptions.h M tools/clang/include/clang/Driver/CC1Options.td M tools/clang/lib/Frontend/CompilerInvocation.cpp M tools/clang/lib/Driver/Tools.cpp M tools/clang/lib/CodeGen/CodeGenFunction.cpp M tools/clang/lib/CodeGen/CodeGenFunction.h % cd /usr/src/usr.bin/clang % make clean && make && make install troutmask:kargl[211] make testf clang -o testf -O2 -march=native -pipe -pg -v -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -lm FreeBSD clang version 2.8 (tags/RELEASE_28 115870) 20101007 Target: x86_64-undermydesk-freebsd9.0 Thread model: posix clang: warning: the clang compiler does not support '-pg' "/usr/bin/clang" -cc1 -triple x86_64-undermydesk-freebsd9.0 -S -disable-free -main-file-name testf.c -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-cpu athlon-fx -v -resource-dir /usr/lib/clang/2.8 -I /usr/local/include -I ../mp -O2 -ferror-limit 19 -fmessage-length 96 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-sShp59.s -x c testf.c clang -cc1 version 2.8 based upon llvm 2.8svn hosted on x86_64-undermydesk-freebsd9.0 ignoring nonexistent directory "/usr/lib/clang/2.8/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include ../mp /usr/include/clang/2.8 /usr/include End of search list. "/usr/bin/as" -o /tmp/cc-Rz3bps.o /tmp/cc-sShp59.s "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 -o testf /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib -L../mp /tmp/cc-Rz3bps.o -lsgk -lmpfr -lgmp -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o So, I must be doing something wrong. I'll poke around in my tree. :( -- Steve From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 20 21:39:29 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BB6E1065670 for ; Thu, 20 Jan 2011 21:39:29 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id 536048FC16 for ; Thu, 20 Jan 2011 21:39:29 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 69EB0F0702A for ; Thu, 20 Jan 2011 21:39:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=/BDf6gUMEzm1a+RtQ3aCZArfB+U =; b=gI1GHQHgMzp1y7wkGGgodNDLiJgku/nvvgwjg3fHqpUpYZcyiOk9tJiReIA xI3578yGb1WeIEbRR0/s+9nmgnvjZ7fZsaRftRIQJx8NIcCS+UeKAj71/j1kxrnV oe2Dc0towBOCD4Yz0vvfLHMT/JFSgO6khwD3uMR9NARmaO98= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=i1lUwOOZaAQeF8cyLe1rr eHi76sR4jK/SRoPl6idt0mnZAQUVz9cd0Sj98MciyQHW9zrFLAvWOJPYbVTBUpHs BDdPYQSYXEJW8RHg/2IPCtflAqQfCtgAm3BiTXQccmUODc65S5asMWENEMOR0otM Z7ncPHNt0QQlsz0yrKQ4CY= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id 42DDCF07025 for ; Thu, 20 Jan 2011 21:39:28 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Thu, 20 Jan 2011 21:39:32 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110120213928.42DDCF07025@mail.your.org> X-Mailman-Approved-At: Thu, 20 Jan 2011 21:47:43 +0000 Subject: buildbot success in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 21:39:29 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIHJlc3RvcmVkIGJ1aWxkIG9uIGJ1aWxkZXIgZnJl ZWJzZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBjbGFuZy4KRnVsbCBkZXRhaWxzIGFyZSBh dmFpbGFibGUgYXQ6CiBodHRwOi8vbGx2bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvYnVp bGRlcnMvZnJlZWJzZC1jbGFuZy1hbWQ2NC9idWlsZHMvNTEKCkJ1aWxkYm90IFVSTDogaHR0cDov L2xsdm0tYW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwLwoKQnVpbGRzbGF2ZSBmb3IgdGhpcyBC dWlsZDogZnJlZWJzZC1hbWQ2NAoKQnVpbGQgUmVhc29uOiBzY2hlZHVsZXIKQnVpbGQgU291cmNl IFN0YW1wOiAxMjM5MzkKQmxhbWVsaXN0OiBicnVubyxrcmVtZW5lawoKQnVpbGQgc3VjY2VlZGVk IQoKc2luY2VyZWx5LAogLVRoZSBCdWlsZGJvdAoK From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 20 21:52:15 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58516106566B for ; Thu, 20 Jan 2011 21:52:15 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id AF80C8FC16 for ; Thu, 20 Jan 2011 21:52:14 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 114B69CB0CC; Thu, 20 Jan 2011 22:52:13 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 88mJwT212CtT; Thu, 20 Jan 2011 22:52:11 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id BC3B49CB153; Thu, 20 Jan 2011 22:52:11 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0KLqBSu016084; Thu, 20 Jan 2011 22:52:11 +0100 (CET) (envelope-from rdivacky) Date: Thu, 20 Jan 2011 22:52:11 +0100 From: Roman Divacky To: Steve Kargl Message-ID: <20110120215211.GA15379@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> <20110120214503.GA19077@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110120214503.GA19077@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 21:52:15 -0000 On Thu, Jan 20, 2011 at 01:45:03PM -0800, Steve Kargl wrote: > On Thu, Jan 20, 2011 at 07:54:49PM +0100, Roman Divacky wrote: > > > > ok, I sat down and implemented what Hans Ottevanger told me to do :) > > > > http://lev.vlakno.cz/~rdivacky/clang-gprof.patch > > > > Wow. Thanks. > > I tried applying your patch to > > % svn update > At revision 217661. > % cd /usr/src/contrib/llvm/tools/clang > % patch < /usr/home/kargl/clang-gprof.patch | & tee sgk.log > > Inspection of sgk.log found > > |Index: include/clang/Frontend/CodeGenOptions.h > |=================================================================== > |--- include/clang/Frontend/CodeGenOptions.h (revision 123935) > |+++ include/clang/Frontend/CodeGenOptions.h (working copy) > -------------------------- > Patching file include/clang/Frontend/CodeGenOptions.h using Plan A... > Hunk #1 failed at 56. > Hunk #2 failed at 126. > 2 out of 2 hunks failed--saving rejects to include/clang/Frontend/CodeGenOptions.h.rej > > |Index: lib/Driver/Tools.cpp > |=================================================================== > |--- lib/Driver/Tools.cpp (revision 123935) > |+++ lib/Driver/Tools.cpp (working copy) > -------------------------- > Patching file lib/Driver/Tools.cpp using Plan A... > Hunk #1 failed at 1280. > Hunk #2 succeeded at 1452 (offset -259 lines). > Hunk #3 succeeded at 3131 (offset -7 lines). > Hunk #4 succeeded at 2967 (offset -245 lines). > 1 out of 4 hunks failed--saving rejects to lib/Driver/Tools.cpp.rej > > I applied the rejected parts by hand (which might be a cause for > the problem below). > > % cd ../../ > % svn status > ? tools/clang/sgk.log > M tools/clang/include/clang/Frontend/CodeGenOptions.h > M tools/clang/include/clang/Driver/CC1Options.td > M tools/clang/lib/Frontend/CompilerInvocation.cpp > M tools/clang/lib/Driver/Tools.cpp > M tools/clang/lib/CodeGen/CodeGenFunction.cpp > M tools/clang/lib/CodeGen/CodeGenFunction.h > > % cd /usr/src/usr.bin/clang > % make clean && make && make install > > troutmask:kargl[211] make testf > clang -o testf -O2 -march=native -pipe -pg -v -I/usr/local/include -I../mp testf.c -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -lm > FreeBSD clang version 2.8 (tags/RELEASE_28 115870) 20101007 > Target: x86_64-undermydesk-freebsd9.0 > Thread model: posix > clang: warning: the clang compiler does not support '-pg' > "/usr/bin/clang" -cc1 -triple x86_64-undermydesk-freebsd9.0 -S -disable-free -main-file-name testf.c -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-cpu athlon-fx -v -resource-dir /usr/lib/clang/2.8 -I /usr/local/include -I ../mp -O2 -ferror-limit 19 -fmessage-length 96 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-sShp59.s -x c testf.c > clang -cc1 version 2.8 based upon llvm 2.8svn hosted on x86_64-undermydesk-freebsd9.0 > ignoring nonexistent directory "/usr/lib/clang/2.8/include" > #include "..." search starts here: > #include <...> search starts here: > /usr/local/include > ../mp > /usr/include/clang/2.8 > /usr/include > End of search list. > "/usr/bin/as" -o /tmp/cc-Rz3bps.o /tmp/cc-sShp59.s > "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 -o testf /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib -L../mp /tmp/cc-Rz3bps.o -lsgk -lmpfr -lgmp -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o > > So, I must be doing something wrong. I'll poke around in my tree. :( steve, I believe you're better off using TRUNK llvm/clang with this (and for your benchmarking purposes - as trunk llvm improved considerably compared to 2.8). dim@ will be importing newer clang/llvm RSN so the patch should apply. anyway, regardless of the warnings - does the "call .mcount" show in your app? the -pg argument was handled in a way of "shout a warning but proceed" so it may very well be that clang is (due to a mismerge) complaining but working fine. roman From owner-freebsd-toolchain@FreeBSD.ORG Fri Jan 21 04:11:21 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC87E106566C for ; Fri, 21 Jan 2011 04:11:21 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id C3F998FC15 for ; Fri, 21 Jan 2011 04:11:21 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id E520AF0C126 for ; Fri, 21 Jan 2011 04:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=/yqEXeOyw33uYDzLwxOO3A1mMoY =; b=NduhLLZ4jEL0zdMoLr1o7ZHmeNSs7Zy8w94OdchMN0n8Q2TtGIqDXJDUmej 4JBJFewMnaB+kmGm6F7c4FpsyahK4DyH52GxVWCwQ5UcXihakolpYxmx9/etKoBB lvQmuPKm4wBsvge/t8UsGQ4jpBFI3SBIDi9AP4CfwxQlbmF0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=mn+vWWoZLhXdR1998mYbW Ty3PTxStapzHBjKikSYMlpgTdvdJNxVOyBMJb2Rnd29/8RCs1VPxOZpvBnojKLib VRHXSqK7O3IvDX8jtFDx/d/dJXVslUBLzxsMFFOJ3waAxJh3A0mdt7zW4FZ7Oe6/ vbQeVGkMZqltVHPnA6aX+o= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id A828BF0C0FC for ; Fri, 21 Jan 2011 04:11:20 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Fri, 21 Jan 2011 04:11:25 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110121041120.A828BF0C0FC@mail.your.org> X-Mailman-Approved-At: Fri, 21 Jan 2011 05:08:59 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 04:11:22 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBsbHZtLgpGdWxsIGRldGFpbHMgYXJlIGF2YWls YWJsZSBhdDoKIGh0dHA6Ly9sbHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC9idWlsZGVy cy9mcmVlYnNkLWNsYW5nLWFtZDY0L2J1aWxkcy81NAoKQnVpbGRib3QgVVJMOiBodHRwOi8vbGx2 bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvCgpCdWlsZHNsYXZlIGZvciB0aGlzIEJ1aWxk OiBmcmVlYnNkLWFtZDY0CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2UgU3Rh bXA6IDEyMzk2MwpCbGFtZWxpc3Q6IG1zcGVuY2VyLG5pY2hvbGFzLHBjYwoKQlVJTEQgRkFJTEVE OiBmYWlsZWQgY29tcGlsZS1mcmVlYnNkLWtlcm5lbAoKc2luY2VyZWx5LAogLVRoZSBCdWlsZGJv dAoK From owner-freebsd-toolchain@FreeBSD.ORG Fri Jan 21 08:19:54 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 341D5106564A for ; Fri, 21 Jan 2011 08:19:54 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id 0BAB18FC0A for ; Fri, 21 Jan 2011 08:19:53 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 40914F0C0C4 for ; Fri, 21 Jan 2011 08:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=X6NCmq8Wc15/LMRVnXUphyNFYgU =; b=STkySKt05+39GMZ5Pz+JDJjcZQttzcq4LFohTSWNsbwsWtgDK7ACEcF3xVT LELh6S8IagCsJQ4mTg6LoK0IUs3o72GFH21PXlGjFIbS7iXPq2gOyEMImvMW3nh3 5D2tOXdrt4qVwp9Nogl/cM2TcCcycZpHFcnGXLq/5qbxsYDk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=h2S10G9LeCYAWuZAi2Dbq ZgfH87KQ2TdaVtO3Z/7ohHOPmf7SDpxTsppud+nl98GXmll5RMgw021AtHoRkyQD G3ZHLr1h3QtJlCYx4oMi6YzeGw55wS0KWwIZ2RfeSR96Bg7+runzkCtZzgmSq6bZ Mwb5e110Q55pHZmIzQ+SN0= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id 16B51F07024 for ; Fri, 21 Jan 2011 08:19:52 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Fri, 21 Jan 2011 08:19:57 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110121081953.16B51F07024@mail.your.org> X-Mailman-Approved-At: Fri, 21 Jan 2011 12:31:32 +0000 Subject: buildbot success in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 08:19:54 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIHJlc3RvcmVkIGJ1aWxkIG9uIGJ1aWxkZXIgZnJl ZWJzZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBsbHZtLgpGdWxsIGRldGFpbHMgYXJlIGF2 YWlsYWJsZSBhdDoKIGh0dHA6Ly9sbHZtLWFtZDY0LmZyZWVic2QueW91ci5vcmc6ODAxMC9idWls ZGVycy9mcmVlYnNkLWNsYW5nLWFtZDY0L2J1aWxkcy81NQoKQnVpbGRib3QgVVJMOiBodHRwOi8v bGx2bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvCgpCdWlsZHNsYXZlIGZvciB0aGlzIEJ1 aWxkOiBmcmVlYnNkLWFtZDY0CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2Ug U3RhbXA6IDEyMzk3MgpCbGFtZWxpc3Q6IGF0cmljayxkZ3JlZ29yLGxhdHRuZXIsbXNwZW5jZXIK CkJ1aWxkIHN1Y2NlZWRlZCEKCnNpbmNlcmVseSwKIC1UaGUgQnVpbGRib3QKCg== From owner-freebsd-toolchain@FreeBSD.ORG Fri Jan 21 15:06:16 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 696EB106566B for ; Fri, 21 Jan 2011 15:06:16 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 207E38FC14 for ; Fri, 21 Jan 2011 15:06:15 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0A8639CB0B9; Fri, 21 Jan 2011 16:06:14 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NjvuWvDBX-Gb; Fri, 21 Jan 2011 16:06:12 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C7E209CB452; Fri, 21 Jan 2011 16:06:12 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0LF6C4b061964; Fri, 21 Jan 2011 16:06:12 +0100 (CET) (envelope-from rdivacky) Date: Fri, 21 Jan 2011 16:06:12 +0100 From: Roman Divacky To: Nathan Whitehorn Message-ID: <20110121150612.GA61861@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> <4D3885A3.80407@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D3885A3.80407@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org, Steve Kargl Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 15:06:16 -0000 On Thu, Jan 20, 2011 at 12:57:39PM -0600, Nathan Whitehorn wrote: > On 01/20/11 12:54, Roman Divacky wrote: > >ok, I sat down and implemented what Hans Ottevanger told me to do :) > > > > http://lev.vlakno.cz/~rdivacky/clang-gprof.patch > > > >This patch does three things: > > > >1) emits "call .mcount" at the begining of every function body > > It's not always called .mcount. See /sys/$ARCH/include/profile.h > -Nathan fwiw - I updated the patch to use different names on different archs, can you guys review? case llvm::Triple::x86: case llvm::Triple::x86_64: return ".mcount"; case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::ppc: case llvm::Triple::ppc64: return "_mcount"; case llvm::Triple::arm: return "__mcount"; From owner-freebsd-toolchain@FreeBSD.ORG Fri Jan 21 16:42:08 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16032106566C; Fri, 21 Jan 2011 16:42:08 +0000 (UTC) (envelope-from hansot@iae.nl) Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by mx1.freebsd.org (Postfix) with ESMTP id A07198FC1E; Fri, 21 Jan 2011 16:42:07 +0000 (UTC) Received: from merom.hotsoft.nl (beasties.demon.nl [82.161.3.114]) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id p0LGg5PK072419; Fri, 21 Jan 2011 17:42:05 +0100 (CET) (envelope-from hansot@iae.nl) Message-ID: <4D39B75D.6010407@iae.nl> Date: Fri, 21 Jan 2011 17:42:05 +0100 From: Hans Ottevanger User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101212 Thunderbird/3.1.7 MIME-Version: 1.0 To: Roman Divacky References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> In-Reply-To: <20110120185449.GA92860@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 16:42:08 -0000 On 01/20/11 19:54, Roman Divacky wrote: > > ok, I sat down and implemented what Hans Ottevanger told me to do :) > > http://lev.vlakno.cz/~rdivacky/clang-gprof.patch > I have installed clang and the patch you provided in the following way: cd /home/hans mkdir clang export PATH=/home/hans/clang/bin:$PATH mkdir testllvm cd testllvm mkdir build svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm cd llvm/tools svn co http://llvm.org/svn/llvm-project/cfe/trunk clang cd clang/ patch < /tmp/clang-gprof.patch 2>&1 | tee /tmp/log cd ../../.. cd build ../llvm/configure --prefix=$HOME/clang gmake -j 4 gmake install > This patch does three things: > > 1) emits "call .mcount" at the begining of every function body > The differences on i386 between profiled and non-profiled code are not as obvious as with gcc (using diff on assembly output), but on first inspection it looks correct. > 2) changes the driver to link in gcrt1.o instead of crt1.o > > 3) changes all -lfoo to -lfoo_p except when the foo ends with _s in > the linker invocation > With gcc the libraries specified by the caller are left alone, maybe for a good reason (more control over what really gets linked). On amd64 (9.0-CURRENT r217444) calling gcc -v -O2 -o tf tf.c -lm yields /usr/bin/ld --eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1 -o tf /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib -L/usr/lib /var/tmp//ccnOsNq4.o -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o and gcc -v -pg -O2 -o tf tf.c -lm results in /usr/bin/ld --eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1 -o tf /usr/lib/gcrt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib -L/usr/lib /var/tmp//cc9Btbiv.o -lm -lgcc_p -lgcc_eh_p -lc_p -lgcc_p -lgcc_eh_p /usr/lib/crtend.o /usr/lib/crtn.o Maybe it is wise to follow the gcc implementation here. > I am not sure that I did the right thing, especially in (3). Anyway, > the patch works for me (ie. produces a.out.gmon that seems to contain > meaningful data). > > I would appreciate if you guys could test and review this. Letting me > know if this is correct. > On both my systems (i386 and amd64) something goes severely wrong when linking several objects (all compiled with -pg, this is amd64): clang -v -pg -O2 -Wall -o test test.o angle.o apsis.o error.o minmax.o qags.o qext.o qk21.o sort.o timint.o zero.o vmol.o -lm clang version 2.9 (trunk 123975) Target: x86_64-unknown-freebsd9.0 Thread model: posix "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 -o test /usr/lib/gcrt1.o /usr/lib/crti.o /usr/lib/crtbegin.o test.o angle.o apsis.o error.o minmax.o qags.o qext.o qk21.o sort.o timint.o zero.o vmol.o ld /usr/bin/ld --as-needed -lgcc_s --no-as-needed ld /usr/bin/ld --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o /usr/bin/ld: ld: No such file: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) Polishing the linker invocation a bit as follows "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 -o test /usr/lib/gcrt1.o /usr/lib/crti.o /usr/lib/crtbegin.o test.o angle.o apsis.o error.o minmax.o qags.o qext.o qk21.o sort.o timint.o zero.o vmol.o -lm_p --as-needed -lgcc_s -lc_p --no-as-needed --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o yields a profiled executable. running gprof on the test.gmon file gives results that are very similar to those when compiling with gcc: the number of calls is identical and the time spent is comparable. Perhaps the invocation of the linker still needs some work (or I must redo my installation) but anyhow it looks like a good job. Thanks! Kind regards, Hans From owner-freebsd-toolchain@FreeBSD.ORG Fri Jan 21 19:27:54 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA02106566B for ; Fri, 21 Jan 2011 19:27:54 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 033258FC19 for ; Fri, 21 Jan 2011 19:27:53 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 2EACB9CB0C3; Fri, 21 Jan 2011 20:27:52 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1R+N9wCgBtxk; Fri, 21 Jan 2011 20:27:51 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 66D6A9CB125; Fri, 21 Jan 2011 20:27:51 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0LJRplK094634; Fri, 21 Jan 2011 20:27:51 +0100 (CET) (envelope-from rdivacky) Date: Fri, 21 Jan 2011 20:27:51 +0100 From: Roman Divacky To: Hans Ottevanger Message-ID: <20110121192751.GA94113@freebsd.org> References: <20110117184411.GA54556@troutmask.apl.washington.edu> <20110118143205.GA34216@freebsd.org> <20110118160252.GA6506@troutmask.apl.washington.edu> <20110120185449.GA92860@freebsd.org> <4D39B75D.6010407@iae.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <4D39B75D.6010407@iae.nl> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: How to build an executable with profiling? X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2011 19:27:54 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > >This patch does three things: > > > >1) emits "call .mcount" at the begining of every function body > > >=20 > The differences on i386 between profiled and non-profiled code are not=20 > as obvious as with gcc (using diff on assembly output), but on first=20 > inspection it looks correct. =20 cool :) > >2) changes the driver to link in gcrt1.o instead of crt1.o > > > >3) changes all -lfoo to -lfoo_p except when the foo ends with _s in > > the linker invocation > > >=20 > Maybe it is wise to follow the gcc implementation here. =20 ok, makes sense > >I am not sure that I did the right thing, especially in (3). Anyway, > >the patch works for me (ie. produces a.out.gmon that seems to contain > >meaningful data). > > > >I would appreciate if you guys could test and review this. Letting me > >know if this is correct. > > >=20 > On both my systems (i386 and amd64) something goes severely wrong when=20 > linking several objects (all compiled with -pg, this is amd64): >=20 > Perhaps the invocation of the linker still needs some work (or I must=20 > redo my installation) but anyhow it looks like a good job. Thanks! I rewrote the libraries rewriting part to match gcc as close as possible. I also think that I solved your ld problem.. please revert the old patch and test the new one: http://lev.vlakno.cz/~rdivacky/clang-gprof.patch I believe this one is ok (works for me just fine), please test and report back so I can start integrating this upstream. thank you! roman --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk053jcACgkQLVEj6D3CBEw1wwCdH++nQM1cTsxsRRFHu7So7KLp v6wAnjRpPo1JjlQxjOR1E+03Rbh6wT3P =W0vz -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm-- From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 01:35:21 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09E75106566B for ; Sat, 22 Jan 2011 01:35:21 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id D53E88FC1A for ; Sat, 22 Jan 2011 01:35:20 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 22906F0C128 for ; Sat, 22 Jan 2011 01:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=FM06Fa/FZPBG1hKgt1hW/r9h8hM =; b=JL+XHJ4gp2DL2uBl06JtUIc1pPr6cBlu9g2KtLxSCX3OMOpsduZIorlpVpR m2kQuIdf9uyu9nG/Wn7Pqj281TXVSEuvZUIqJJl+NcSVGt5uKjYhjiFneUierM0o waf3Hggqg8yZHaUxuvFACPPQxvALFpdHlcLYfLB3Vmt9vt7w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=WkcjiTkYF4WyMmfhYijXS HGP/OsRD/tBXRCsqW5KmwW1uQ34hxRpkwYgNi3rI21rmRYkayhuJ6pmBZ+VLYQ/a xO9+WYFiSazOt6q4EXg7mFc1FP5BIhoQ9DzJFcRyCpJFLVDoH85llcmRc+8+XJmB LYdkJt9s90Cf9QdgmDHLkA= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id D71B5F0C0F7 for ; Sat, 22 Jan 2011 01:35:19 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Sat, 22 Jan 2011 01:35:25 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110122013519.D71B5F0C0F7@mail.your.org> X-Mailman-Approved-At: Sat, 22 Jan 2011 04:45:26 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:35:21 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBjbGFuZy4KRnVsbCBkZXRhaWxzIGFyZSBhdmFp bGFibGUgYXQ6CiBodHRwOi8vbGx2bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvYnVpbGRl cnMvZnJlZWJzZC1jbGFuZy1hbWQ2NC9idWlsZHMvNjQKCkJ1aWxkYm90IFVSTDogaHR0cDovL2xs dm0tYW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwLwoKQnVpbGRzbGF2ZSBmb3IgdGhpcyBCdWls ZDogZnJlZWJzZC1hbWQ2NAoKQnVpbGQgUmVhc29uOiBzY2hlZHVsZXIKQnVpbGQgU291cmNlIFN0 YW1wOiAxMjQwMDUKQmxhbWVsaXN0OiBkZ3JlZ29yLGtyZW1lbmVrCgpCVUlMRCBGQUlMRUQ6IGZh aWxlZCBjb21waWxlLWZyZWVic2Qta2VybmVsCgpzaW5jZXJlbHksCiAtVGhlIEJ1aWxkYm90Cgo= From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 01:45:31 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C85F1106566B for ; Sat, 22 Jan 2011 01:45:31 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id 9F5688FC08 for ; Sat, 22 Jan 2011 01:45:31 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id DB3C3F0C0BF for ; Sat, 22 Jan 2011 01:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=9xTnKUfdcs+XwfbIW6/nyqovJto =; b=ri5yWALRhsZsUqeBhXeWfxmtdHqC6SZWjQO0B9DjmH8bvpKHzE8+c460+pf VmDmFZv4amuGyRamZ5A/GLG9vof53zH45FgTCMr+7gqCHMqVv3xX6G3Oe6DDtYP1 gRNINpNL/ydgMSEyd4at/ycwPb9jToMM+tooalZLhq6Aqsac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=uXsFKQlKoEMzJv+hrDyh6 EfLXg0jL7/AsX961oBZAbSFr5jDBf/h1igdsbKmYA7Q0uIPLwuR7xj/c0MraByhT /VW+1VVxiN/v8gvFkQllD1g/P2ikFOxsLn+pKAMsyTZutF/z+yYeVHeNirHec+ck TTb6ONQwLz21gjLfGEv5gE= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id B71ECF06FED for ; Sat, 22 Jan 2011 01:45:30 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Sat, 22 Jan 2011 01:45:36 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110122014530.B71ECF06FED@mail.your.org> X-Mailman-Approved-At: Sat, 22 Jan 2011 12:08:43 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-i386 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 01:45:31 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1pMzg2IHdoaWxlIGJ1aWxkaW5nIGxsdm0uCkZ1bGwgZGV0YWlscyBhcmUgYXZhaWxh YmxlIGF0OgogaHR0cDovL2xsdm0tYW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwL2J1aWxkZXJz L2ZyZWVic2QtY2xhbmctaTM4Ni9idWlsZHMvNTcKCkJ1aWxkYm90IFVSTDogaHR0cDovL2xsdm0t YW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwLwoKQnVpbGRzbGF2ZSBmb3IgdGhpcyBCdWlsZDog ZnJlZWJzZC1pMzg2CgpCdWlsZCBSZWFzb246IHNjaGVkdWxlcgpCdWlsZCBTb3VyY2UgU3RhbXA6 IDEyMzk5OQpCbGFtZWxpc3Q6IGRqZyx2ZW5rYXRyYQoKQlVJTEQgRkFJTEVEOiBmYWlsZWQgY29t cGlsZS1mcmVlYnNkLXdvcmxkCgpzaW5jZXJlbHksCiAtVGhlIEJ1aWxkYm90Cgo= From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 02:51:46 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 133D21065670 for ; Sat, 22 Jan 2011 02:51:46 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id DEAE48FC0A for ; Sat, 22 Jan 2011 02:51:45 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 3C9E0F0702E for ; Sat, 22 Jan 2011 02:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=cY9lAQaTpxn7qp2zdbi08QIRW9o =; b=ikBEDMl1NrzxsyfwVciV1PCe39qqm+ULtr2rItFFgy+MzsqaXULVGnrs3LP L/Qr4OwHMmuMpNBfDh/Osa0EZtxIqeANw3ZtpRgdwPmACYvxTllqkJ00tvTgDpJt lsvCTeF/pS+906xk6RGHdLf0hTcOUdlv0uf7v6xJnyAZMwaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=ftAVzgzzQirUzKhw9uUL8 /ZjK3Mlvb8+oTJhte/dLQYY77gfZexo/s/hI6Hqk8O3IAx7HfZBVLvPq5mZaAdi4 Lurc0UJPYQVtcX4/RFqoXJvcHjZ8tB+NdPRHo6NygKtEGaA6DP1ylowxVrKNGtu5 Te60ARv3RW0Uu6pQ9/s4fU= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id 0429FF0701D for ; Sat, 22 Jan 2011 02:51:44 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Sat, 22 Jan 2011 02:51:50 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110122025145.0429FF0701D@mail.your.org> X-Mailman-Approved-At: Sat, 22 Jan 2011 12:09:07 +0000 Subject: buildbot success in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 02:51:46 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIHJlc3RvcmVkIGJ1aWxkIG9uIGJ1aWxkZXIgZnJl ZWJzZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBjbGFuZy4KRnVsbCBkZXRhaWxzIGFyZSBh dmFpbGFibGUgYXQ6CiBodHRwOi8vbGx2bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvYnVp bGRlcnMvZnJlZWJzZC1jbGFuZy1hbWQ2NC9idWlsZHMvNjUKCkJ1aWxkYm90IFVSTDogaHR0cDov L2xsdm0tYW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwLwoKQnVpbGRzbGF2ZSBmb3IgdGhpcyBC dWlsZDogZnJlZWJzZC1hbWQ2NAoKQnVpbGQgUmVhc29uOiBzY2hlZHVsZXIKQnVpbGQgU291cmNl IFN0YW1wOiAxMjQwMDcKQmxhbWVsaXN0OiBkZ3JlZ29yCgpCdWlsZCBzdWNjZWVkZWQhCgpzaW5j ZXJlbHksCiAtVGhlIEJ1aWxkYm90Cgo= From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 12:12:41 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36741106566B for ; Sat, 22 Jan 2011 12:12:41 +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 A3A158FC18 for ; Sat, 22 Jan 2011 12:12:40 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0MCCajt092280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 22 Jan 2011 14:12:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0MCCapq070165 for ; Sat, 22 Jan 2011 14:12:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0MCCamn070164 for freebsd-toolchain@freebsd.org; Sat, 22 Jan 2011 14:12:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 22 Jan 2011 14:12:36 +0200 From: Kostik Belousov To: freebsd-toolchain@freebsd.org Message-ID: <20110122121236.GE2518@deviant.kiev.zoral.com.ua> References: <20110122014530.B71ECF06FED@mail.your.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wg2zgDM1gLxA7pbN" Content-Disposition: inline In-Reply-To: <20110122014530.B71ECF06FED@mail.your.org> 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.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS,WEIRD_PORT autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Subject: Re: buildbot failure in FreeBSD/clang on freebsd-clang-i386 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 12:12:41 -0000 --wg2zgDM1gLxA7pbN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 22, 2011 at 01:45:36AM +0000, buildbot@llvm-amd64.freebsd.your.= org wrote: > The Buildbot has detected a new failure on builder freebsd-clang-i386 whi= le building llvm. > Full details are available at: > http://llvm-amd64.freebsd.your.org:8010/builders/freebsd-clang-i386/buil= ds/57 >=20 > Buildbot URL: http://llvm-amd64.freebsd.your.org:8010/ >=20 > Buildslave for this Build: freebsd-i386 >=20 > Build Reason: scheduler > Build Source Stamp: 123999 > Blamelist: djg,venkatra >=20 > BUILD FAILED: failed compile-freebsd-world >=20 > sincerely, > -The Buildbot Can we remove this bot from freebsd-toolchain@, please ? There is nothing that freebsd developers are responsible for, nor can fix. --wg2zgDM1gLxA7pbN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk06ybQACgkQC3+MBN1Mb4j5nACgiBzCVy0kyuFYzZNKlJvLT4ND +m8AnRUcSp1BBu9W+jQPVH8Yqzgxc3g6 =oQvG -----END PGP SIGNATURE----- --wg2zgDM1gLxA7pbN-- From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 12:44:57 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D323106566B for ; Sat, 22 Jan 2011 12:44:57 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id BD8538FC0A for ; Sat, 22 Jan 2011 12:44:56 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 79E949CB0D1; Sat, 22 Jan 2011 13:44:54 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dsx1Yr2Yftdd; Sat, 22 Jan 2011 13:44:53 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7BB629CB125; Sat, 22 Jan 2011 13:44:53 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0MCirln026516; Sat, 22 Jan 2011 13:44:53 +0100 (CET) (envelope-from rdivacky) Date: Sat, 22 Jan 2011 13:44:53 +0100 From: Roman Divacky To: Kostik Belousov Message-ID: <20110122124453.GA26022@freebsd.org> References: <20110122014530.B71ECF06FED@mail.your.org> <20110122121236.GE2518@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110122121236.GE2518@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: buildbot failure in FreeBSD/clang on freebsd-clang-i386 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 12:44:57 -0000 On Sat, Jan 22, 2011 at 02:12:36PM +0200, Kostik Belousov wrote: > On Sat, Jan 22, 2011 at 01:45:36AM +0000, buildbot@llvm-amd64.freebsd.your.org wrote: > > The Buildbot has detected a new failure on builder freebsd-clang-i386 while building llvm. > > Full details are available at: > > http://llvm-amd64.freebsd.your.org:8010/builders/freebsd-clang-i386/builds/57 > > > > Buildbot URL: http://llvm-amd64.freebsd.your.org:8010/ > > > > Buildslave for this Build: freebsd-i386 > > > > Build Reason: scheduler > > Build Source Stamp: 123999 > > Blamelist: djg,venkatra > > > > BUILD FAILED: failed compile-freebsd-world > > > > sincerely, > > -The Buildbot > Can we remove this bot from freebsd-toolchain@, please ? > There is nothing that freebsd developers are responsible for, nor can fix. I agree that it does not make much sense to report when freebsd world is broken (with any compiler) nor when llvm is broken everywhere and not only on freebsd. On the other hand I think it's very useful to know when llvm breaks on freebsd only or when freebsd world is not compilable with llvm (be it a bug in freebsd that gcc does not catch or llvm bug). I dont know how to achieve this, any ideas? Anyway, the number of mails should go down, it's spamming a little too much. roman From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 13:08:19 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD221065694; Sat, 22 Jan 2011 13:08:19 +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 B55898FC13; Sat, 22 Jan 2011 13:08:18 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0MD8EZQ096574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Jan 2011 15:08:14 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0MD8Eag070357; Sat, 22 Jan 2011 15:08:14 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0MD8EQB070356; Sat, 22 Jan 2011 15:08:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 22 Jan 2011 15:08:14 +0200 From: Kostik Belousov To: Roman Divacky Message-ID: <20110122130814.GF2518@deviant.kiev.zoral.com.ua> References: <20110122014530.B71ECF06FED@mail.your.org> <20110122121236.GE2518@deviant.kiev.zoral.com.ua> <20110122124453.GA26022@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ESXajHq3/vK+Jgyg" Content-Disposition: inline In-Reply-To: <20110122124453.GA26022@freebsd.org> 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.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS,WEIRD_PORT autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-toolchain@freebsd.org Subject: Re: buildbot failure in FreeBSD/clang on freebsd-clang-i386 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 13:08:19 -0000 --ESXajHq3/vK+Jgyg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 22, 2011 at 01:44:53PM +0100, Roman Divacky wrote: > On Sat, Jan 22, 2011 at 02:12:36PM +0200, Kostik Belousov wrote: > > On Sat, Jan 22, 2011 at 01:45:36AM +0000, buildbot@llvm-amd64.freebsd.y= our.org wrote: > > > The Buildbot has detected a new failure on builder freebsd-clang-i386= while building llvm. > > > Full details are available at: > > > http://llvm-amd64.freebsd.your.org:8010/builders/freebsd-clang-i386/= builds/57 > > >=20 > > > Buildbot URL: http://llvm-amd64.freebsd.your.org:8010/ > > >=20 > > > Buildslave for this Build: freebsd-i386 > > >=20 > > > Build Reason: scheduler > > > Build Source Stamp: 123999 > > > Blamelist: djg,venkatra > > >=20 > > > BUILD FAILED: failed compile-freebsd-world > > >=20 > > > sincerely, > > > -The Buildbot > > Can we remove this bot from freebsd-toolchain@, please ? > > There is nothing that freebsd developers are responsible for, nor can f= ix. >=20 > I agree that it does not make much sense to report when freebsd world > is broken (with any compiler) nor when llvm is broken everywhere and not = only > on freebsd. >=20 > On the other hand I think it's very useful to know when llvm breaks on fr= eebsd > only or when freebsd world is not compilable with llvm (be it a bug in fr= eebsd > that gcc does not catch or llvm bug). My take is that would be indeed useful to have tinderbox-like reports for world and kernel compiled with _in-tree_ llvm. I am fine with receiving llvm-buildworld failures that duplicate the failures from gcc tinderbox. Anything else should be kept to llvm lists or anybody private mailings. >=20 > I dont know how to achieve this, any ideas? >=20 > Anyway, the number of mails should go down, it's spamming a little too mu= ch. >=20 > roman --ESXajHq3/vK+Jgyg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk061r4ACgkQC3+MBN1Mb4hlKACfUqtGpnybvz08ovGb638u9OHf E/wAoOXqdMXzeup2PFkGQAJ0YIZDhT5R =7G3n -----END PGP SIGNATURE----- --ESXajHq3/vK+Jgyg-- From owner-freebsd-toolchain@FreeBSD.ORG Sat Jan 22 14:27:13 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1917106564A for ; Sat, 22 Jan 2011 14:27:13 +0000 (UTC) (envelope-from buildbot@llvm-amd64.freebsd.your.org) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mx1.freebsd.org (Postfix) with ESMTP id C91B38FC14 for ; Sat, 22 Jan 2011 14:27:13 +0000 (UTC) Received: from mail.your.org (chi02.mail.your.org [204.9.55.23]) by mail.your.org (Postfix) with ESMTP id 26DADF0C0FB for ; Sat, 22 Jan 2011 14:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; s=selector1; bh=1ClX3cynqZZwa4bwdPrwv64gIRs =; b=4+aIyWRbDsu+0A2w8tMAmcITLNWr4M8CA5GTTYn8TqFpBluqoU+UEYK/eFa WgZgcX3UQcYx8xmCsp8dU+3WwgfbZNo0xYIN/NxPkcGoWw00ieq/mMJooviG/oA+ 471vX+CAoC2e+LRQog7KNjOxEYKm1iJOA/ERbYdEXV5dUlEY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=your.org; h= content-transfer-encoding:mime-version:content-type:date:subject :from:to:message-id; q=dns; s=selector1; b=gYDY66YLks6JbM9Fhfo8/ 5tV6w82ltgFDfF2rIQ+vxQDGbiE2TVf4ddb8S3ShgtMTzKYzbb0CDDw2vbS01Ci5 Trn/Ao86hUt9j+Me6zd4FdNS5aIYmcmQ2K458o+QfNaY6yJdd0BTTqOHld+ew/Ct pFwE+VoT34SdJFsec6eMsg= Received: from llvm-amd64.freebsd.your.org (llvm-amd64.freebsd.your.org [216.14.102.20]) by mail.your.org (Postfix) with ESMTP id DB15EF0C0BF for ; Sat, 22 Jan 2011 14:27:12 +0000 (UTC) Content-Transfer-Encoding: base64 MIME-Version: 1.0 Content-Type: text/plain; charset="utf8" Date: Sat, 22 Jan 2011 14:27:18 +0000 From: buildbot@llvm-amd64.freebsd.your.org To: freebsd-toolchain@freebsd.org Message-Id: <20110122142712.DB15EF0C0BF@mail.your.org> X-Mailman-Approved-At: Sat, 22 Jan 2011 17:05:57 +0000 Subject: buildbot failure in FreeBSD/clang on freebsd-clang-amd64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2011 14:27:14 -0000 VGhlIEJ1aWxkYm90IGhhcyBkZXRlY3RlZCBhIG5ldyBmYWlsdXJlIG9uIGJ1aWxkZXIgZnJlZWJz ZC1jbGFuZy1hbWQ2NCB3aGlsZSBidWlsZGluZyBjbGFuZy4KRnVsbCBkZXRhaWxzIGFyZSBhdmFp bGFibGUgYXQ6CiBodHRwOi8vbGx2bS1hbWQ2NC5mcmVlYnNkLnlvdXIub3JnOjgwMTAvYnVpbGRl cnMvZnJlZWJzZC1jbGFuZy1hbWQ2NC9idWlsZHMvNzAKCkJ1aWxkYm90IFVSTDogaHR0cDovL2xs dm0tYW1kNjQuZnJlZWJzZC55b3VyLm9yZzo4MDEwLwoKQnVpbGRzbGF2ZSBmb3IgdGhpcyBCdWls ZDogZnJlZWJzZC1hbWQ2NAoKQnVpbGQgUmVhc29uOiBzY2hlZHVsZXIKQnVpbGQgU291cmNlIFN0 YW1wOiAxMjQwMjkKQmxhbWVsaXN0OiBkMGsKCkJVSUxEIEZBSUxFRDogZmFpbGVkIGNvbXBpbGUt ZnJlZWJzZC1rZXJuZWwKCnNpbmNlcmVseSwKIC1UaGUgQnVpbGRib3QKCg==