Re: How to get profile data?

"Grzegorz B. Prokopski" <[email protected]>
Newsgroups gmane.comp.java.vm.sablevm.general,gmane.comp.java.vm.sablevm.devel
Organization SableVM - LGPL'ed Free Java VM http://sablevm.org
Message-ID <[email protected]>
Hi,

On Mon, 2004-10-25 at 22:33, fei yang wrote:
>     I am a student coming from China and I am interesting in GC
> Algorithm. Now I write a new algorithm based sablevm1.0.9(include
> three parts: class-library-1.0.9, native-library-1.0.9, sablevm-1.0.9)
> in RedHat 7.3, with gcc 2.96. but I can't get profile data.

Firstly, 1.0.9 is *very* old.  You should really be using latest
released version, which ATM is 1.1.6.  Or, it might turn out, that in
your case you should actually either wait for 1.1.7 to be released or
use latest staging version ("staging" is our main development branch).

>     First, I installed class-library, native-library, when configuring
> sablevm-1.0.9, I added option CFLAGS=-pg. After make and make intall,
> I used specjvm98 _201_compress to test, got gmon.out.

I don't think you can just set CFLAGS to whatever you want.  SableVM,
unless specially instructed, is quite picky as to what CFLAGS are set
to. 

>     Then, I used gprof to analyse gmon.out, I got the following
> result, no subfunctions's profile data.
>  
> Flat profile:
> Each sample counts as 0.01 seconds.
>  no time accumulated
>   %   cumulative   self              self     total
>  time   seconds   seconds    calls  Ts/call  Ts/call  name
>   0.00      0.00     0.00       14     0.00     0.00  data_start
>   0.00      0.00     0.00        2     0.00     0.00  getProperties
>   0.00      0.00     0.00        1     0.00     0.00  parseConfig
>   0.00      0.00     0.00        1     0.00     0.00 
> printVersionAndCopyright

I am not sure if gprof is able to deal with libraries and/or
multi-threaded applications.  I'd suggest you use something like
qprof (from HP).

Time for something constructive.

In current development versions I added --with-profiling= configure
switch, that has two values "gprof" or "nostatic".  If you want to
use gprof, just use --with-profiling=gprof.  If you want to use
qprof - you'll need to pass --with-profiling=nostatic.  This switch
will remove "static" keyword from definitions of many functions of
libsablevm, making the functions visible to outside worlds and also
profiler (i.e. qprof).

This switch is not yet present in 1.1.6 so you should either wait
for 1.1.7 (hopefuly to be finally released) or get the latest
development version from "staging" repository.  Unfortunatelly
we don't have daily snapshots available at the moment.

Hope this helps,

				Grzegorz B. Prokopski

PS: Sending CC: to sablevm-user (as the original poster *also* sent this
question there), but I suggest further emails on this issue should only
be addressed to sablevm-devel.
-- 
Grzegorz B. Prokopski           <[email protected]>
SableVM - Free, LGPL'ed Java VM  http://sablevm.org
Why SableVM ?!?                  http://sablevm.org/wiki/Features
Debian GNU/Linux - the Free OS   http://www.debian.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.