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 14:55:02 PST From: "Rajanish Calisa" Newsgroups: comp.unix.tru64 References: <932m0m$ths$1@nnrp1.deja.com> <3A55E434.D4EE19DF@one.net.au> Subject: Re: atom (hiprof) woes X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Message-ID: NNTP-Posting-Host: 1cust74.tnt9.syd2.da.uu.net X-Trace: ozemail.com.au 978735257 63.34.228.74 (Sat, 06 Jan 2001 09:54:17 EST) NNTP-Posting-Date: Sat, 06 Jan 2001 09:54:17 EST Organization: OzEmail Ltd, Australia Distribution: world Date: Sat, 6 Jan 2001 10:00:54 +1100 Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!osa.uu.net!dfw.uu.net!ash.uu.net!news01.one.net.au!newsfeed.ozemail.com.au!ozemail.com.au!not-for-mail Xref: supernews.google.com comp.unix.tru64:1357 Robert Mulley wrote in message news:3A55E434.D4EE19DF@one.net.au... > 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. > You are wrong. All multi-threaded programs initially start off with one thread, but that does not mean that during such a time, hiprof will not work. hiprof does not care if there is one thread or more, atleast it does not document that I should create more than one thread to make it work, if I specify "-threads" option. The "-threads" option exists only to make hiprof aware that it is an MT program and it provides thread-dependent analysis. Please read up the man pages for "hiprof". As a matter of fact, we are successfully using hiprof/atom on 4.0f. That is why I mentioned at the beginning the versions of various software that we use. > 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. > I do not need a explanation of the program, I am the one who wrote it. > You need to read up some more about thread programming. > I know about threads, I wanted to keep the program as simple as possible. rajanish...