Java Bytecode Profiler

Senthil Kumar skumars at earthlink.net
Tue Nov 10 06:52:25 PST 1998


Tom Harkins wrote:
> 
> I am trying to design a Java Bytecode Profiler using the kaffe source code.
>  I am trying to do some analysis to keep track of branches, jumps, and
> function calls done by the Java Bytecode.  I have downloaded the kaffe
> source code and compiled it on a Sun Ultra-Sparc machine.
> 
> Does anyone know where in the source code I might start to look for the
> code that does the branching and jumping.  I was looking at the
> /kaffe-1.0.b1/kaffe/kaffevm/code-analyse.c file which looks like it is
> parsing out the beginning and end of basic blocks.
> 
> Has anyone attempted to do such a project with or without success.
> 
> Tom

you are on the right track. I think, except for function
calls (INVOKE etc) you can get all such info. Getting info
on function calls shuold be trivial, though. (I think)

I did some work on this.

Just from the size of the byte code, some info can be gathered,
such as:

1. verification time (linear correlation, this is expected)
2. translation time (linear correlation)
3. upper bound to interpret it. This result is quite interesting
   and approximate. I use it to initially estimate the
   time it will take to interpret some given method. Which is
   used in a heuristic to determine if I want to JIT/interpret
   some given method. The interpret time is the time spent
   in some given method, i.e. it does not include time spent
   in subsequent functions calls inside the method.

Senthil


More information about the kaffe mailing list