From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,5b3bca6fd730487a X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-01-05 07:15:37 PST Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!newsgate.tandem.com!mailint03.im.hou.compaq.com!not-for-mail From: Robert Mulley Newsgroups: comp.unix.tru64 Subject: Re: atom (hiprof) woes Date: Fri, 05 Jan 2001 15:11:48 +0000 Organization: Compaq Computer Corp. Message-ID: <3A55E434.D4EE19DF@one.net.au> References: <932m0m$ths$1@nnrp1.deja.com> Reply-To: gnscon@one.net.au NNTP-Posting-Host: 16.37.50.195 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: mailint03.im.hou.compaq.com 978707504 12028 16.37.50.195 (5 Jan 2001 15:11:44 GMT) X-Complaints-To: usenet@mailint03.im.hou.compaq.com NNTP-Posting-Date: 5 Jan 2001 15:11:44 GMT X-Mailer: Mozilla 4.74 [en] (WinNT; U) X-Accept-Language: en Xref: supernews.google.com comp.unix.tru64:1350 Rajanish Calisa wrote: > Hi all, > > We are using Digital Unix 4.0D, Atom(V2.17f/V2.17d), DEC C++(6.2). > > I am trying to use hiprof to profile a multi-threaded app. > To begin with, I wrote a simple program as given below to > tried to profile it: > > ----------------------------------------------------------- > int > bar() > { > for ( int i = 0 ; i < 100 ; i++ ) ; > return 0 ; > } > > int > foo() > { > for ( int i = 0 ; i < 100 ; i++ ) { bar() ; } > return 0 ; > } > > int > main() > { > for ( int i = 0 ; i < 100 ; i++ ) { foo() ; } > return 0 ; > } > ------------------------------------------------------- > > I compiled the program as follows: > cxx -g -pthread hp.cc -o hp > > I tried to profile it as follows: > atom hp -tool hiprof -env threads \ > -toolargs="-textout -cputime -threads" -all -g > > When I run hp.hiprof.threads, I get the following message: > Hiprof Panic: hacked stack back to nothing > > I do not understand what I am doing wrong, when the "threads" > option is not specified during profile and compilation time > it seems to work fine. > > Any help in this regard is appreciated. > > Thanks > > rajanish... > > Sent via Deja.com > http://www.deja.com/ The problem lies in the fact that this is not a multi-threaded program. Nothing about it is thread aware. Every thing is executed sequentially. ie main calls foo which calls bar 100 times, then main calls foo which calls bar 100 times. In total main calls foo 100 times. You need to read up some more about thread programming. Robert Mulley Unix admin Standard Disclaimer: I could be completely wrong but I think I'm right.