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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,67d0b159688c1254 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-07 16:44:38 PST Path: supernews.google.com!sn-xit-02!sn-east!sn-xit-uk!supernews.com!194.42.224.136.MISMATCH!diablo.netcom.net.uk!netcom.net.uk!cpk-news-hub1.bbnplanet.com!news.gtei.net!howland.erols.net!newshub2.home.com!news.home.com!news1.crdva1.bc.home.com.POSTED!not-for-mail Message-ID: <39B8286C.2449C16F@linuxchip.demon.co.uk> From: Dr Adrian Wrigley X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14-5.0smp i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: gcov in multithreaded applications References: <8oip2j$ut0$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 07 Sep 2000 23:44:28 GMT NNTP-Posting-Host: 24.115.103.173 X-Complaints-To: abuse@home.net X-Trace: news1.crdva1.bc.home.com 968370268 24.115.103.173 (Thu, 07 Sep 2000 16:44:28 PDT) NNTP-Posting-Date: Thu, 07 Sep 2000 16:44:28 PDT Organization: Excite@Home - The Leader in Broadband Xref: supernews.google.com comp.lang.ada:541 Date: 2000-09-07T23:44:28+00:00 List-Id: daelen@my-deja.com wrote: > > I am working with Gnat 3.13a on Windows NT 4.0. > > I would like to use gcov to profile our application containing several tasks. If I my experience profiling code with multiple tasks is virtually futile. At least on the Gnat 3.11/Linux on Intel architecture, the basic block counting code is not thread-safe :( This stops reliable block profiling with gcov under gcc. I was using native (Linux) threads. Further, the function/procedure counting was not thread safe either (the mcount does not protect the count). This leads to spurious values in a "gprof" profile of function counts/timing. I was unable to resolve the problem under support from ACT, as it seems to be a problem with the "mcount" in the profiling library, and gcov style block profiling doesn't seem to be supported. I had some success with my own thread-safe alternative to "mcount", but the performance drag was very significant (worse than 3x for heavily nested calling). Also, some success enabling profiling dynamically on a per function basis, by one thread at a time. All this is from memory of over a year ago. Things may have changed. I may have misremembered. Profiling on NT may have fixed the gcov bug. Did you get the results you wanted, Jorg? Were they reliable? -- Adrian Wrigley.