C+Java profiling, debugging, and a feedback infrastructure
tullmann at cs.utah.edu
Thu May 11 12:32:11 PDT 2000
Thanks to excellent work by Tim Stack of our group at the University
of Utah, in support of our work on `Janos', an active networks platform,
we've added one major and two auxiliary enhancements to Kaffe:
* C+Java cross-language gprof support
* C+Java cross-language gdb support
* Basic feedback system
The major work is a system for combined profiling of C and JIT'ed
Java code in Kaffe. This makes it possible to produce timing and call
graph data covering both languages in a format that can be understood
by GNU gprof. The implementation works much like regular C profiling:
it gets timing information by regularly sampling the current value of
the PC and adds a call to an `mcount'-like function to the beginning
of JIT'ed methods. Then, at exit, the profiling data is written out,
as well as an assembler file containing symbol information for the
JIT'ed code. Finally, the JIT'ed code symbol file and a symbol file
created from the Kaffe executable are assembled and fed into gprof to
create the output.
In addition, we have implemented basic functionality to support cross
language debugging in gdb. Cross language debugging simply takes the
line debugging information from the Java class and outputs it to an
assembler file using the same code the profiler used. Then, while
executing in gdb you can assemble the current output file and add the
symbols to gdb's current state, allowing it to report the current
file/line information for JIT'ed Java code.
Finally, we have implemented a basic system for feeding JIT
information back into subsequent runs of Kaffe. The feedback system
allows Kaffe to save certain bits of state to a file so that it can
optimize future runs based on past information. Currently, this is
only used for preloading libraries and pre-JIT'ing methods. However,
it should be flexible enough to hold more data that can be used to do
More information, a patch (187K), and a complete Kaffe source
distribution (both based on early May, 2000 CVS snapshots) can be
found on our Janos Kaffe page:
More information about these additions can be found in the
FAQ.xprofiler, FAQ.xdebugging, and FAQ.feedback files (which
are also on the web page).
Before asking that this stuff get committed to the main tree, we're
looking for some feedback on it. So please send any comments to this
list, the Janos list (janos-discuss at flux.cs.utah.edu) or to myself
(tullmann at cs.utah.edu) and Tim Stack (stack at cs.utah.edu).
Tim Stack, our most recent Kaffe wizard at Utah, actually implemented
all of this. I'm just announcing it.
For those interested in what was actually changed, here is a ChangeLog
Tim Stack <stack at cs.utah.edu>:
* FAQ/FAQ.xprofiler, FAQ/FAQ.xdebugging, FAQ/FAQ.feedback,
configure.in, kaffe/kaffe/main.c, config/i386/jit3-i386.def,
include/Makefile.am, include/Makefile.in, kaffe/Makefile.am,
kaffe/xprof/xprofiler.c: Added/modified to support xprofiling,
xdebugging, and feedback.
----- ----- ---- --- --- -- - - - - -
Pat Tullmann tullmann at cs.utah.edu
Indifference may cause the downfall of mankind, but who really cares?
More information about the kaffe