From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.168.7 with SMTP id f7mr6265426ywh.24.1469465120063; Mon, 25 Jul 2016 09:45:20 -0700 (PDT) X-Received: by 10.157.2.42 with SMTP id 39mr869413otb.3.1469465120026; Mon, 25 Jul 2016 09:45:20 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c52no4840910qte.1!news-out.google.com!d130ni14237ith.0!nntp.google.com!f6no4547767ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Jul 2016 09:45:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8380:7220:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8380:7220:5985:2c17:9409:aa9c References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Profiling Ada binaries From: rieachus@comcast.net Injection-Date: Mon, 25 Jul 2016 16:45:20 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31159 Date: 2016-07-25T09:45:18-07:00 List-Id: On Monday, July 25, 2016 at 3:01:07 AM UTC-4, Markus Sch=C3=B6pflin wrote: I am trying to profile code generated by Gnat using Gprof. For this I add -= pg=20 to the compilation and link switches, turn down optimization to -O1 and=20 disable inlining of functions only called once=20 (-fno-inline-functions-called-once). Gee. I would never think to compile the math libraries with -O1. Seriously= , the math libraries are written with ease of understanding in mind. You m= ay have thousands of calls in the implementation of one function, and due t= o the packages being generic, every one of those calls will do an elaborati= on check. How can that be efficient? I believe GNAT has non-generic versi= ons for Short_Float, Float, and Long_Float which use the hardware built-ins= . But I doubt you would get that automatically with -O1. Try compiling everything with -O3 (or whatever you use) then recompile only= the unit you want the tracing for with -O1 and -fno-inline-functions-calle= d-once.