swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCJ profiling [was: GNU Java Compiler and Swarm]


From: Marcus G. Daniels
Subject: GCJ profiling [was: GNU Java Compiler and Swarm]
Date: 27 Jun 2001 12:45:01 -0600
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

>>>>> "MD" == Marcus G Daniels <address@hidden> writes:

MD> The next thing is to get -pg -static working.  That means that the
MD> dynamic linking emulation needs to work like it does in that Kaffe
MD> profiling example I posted a while ago..  I'll probably have
MD> something to report on that soon.  (Profiling code that uses
MD> dynamic linking is hard to do in a portable way..)

GCJ profiling is working now.  In today's snapshot there is a
"libgcjswarm-prof.la" target in the java/ Makefile that creates the
profiling static library that is needed in order to realistically measure what
is happening with a Java Swarm model.  Due to the way the initialization
of profiling works, you need a fully static link -- that means building 
all of the dependencies of swarm with static libraries.  Here's a copy
of all that for Redhat 7.1:

   ftp://ftp.swarm.org/pub/swarm/binaries/redhat/i386/profiling/prof.tar.bz2

A couple important details:

  1) Set LTDL_LIBRARY_PATH to the place you've
     installed the profiling static libraries for Swarm

     LTDL_LIBRARY_PATH is like LD_LIBRARY_PATH except it is specific to the
     portable libtool interface to dynamic linking.  In this case there
     isn't any real dynamic linking happening, but we still need to make it
     look like there is for the sake of the Java runtime environment.
     The JVM (or GCJ runtime) will query C symbols, etc..

  2) in order to link up this library, the latest libtool is needed in
     your PATH (not the one in Swarm itself).  This is available by
     CVS from subversions.gnu.org.

Below are some example added Makefile rules for Java heatbugs.  Note
how a whole JAR file can be converted in to native code.  The -dlpreopen
tells libtool to create some C data structures that support dynamic linking
emulation in static builds.  Note that like the Kaffe xprofiling example,
this also uses depend.m (attached).

SWARMBUILD = $(B)/swarm-jdk-static-prof
LIBGCJSWARM_LA = $(SWARMBUILD)/java/libgcjswarm.la
GCJFLAGS = -O2 -g -pg -fjni
GCJ = gcj

jheatbugs.jar: all
        jar cf jheatbugs.jar *.class

jheatbugs.lo: jheatbugs.jar
        CLASSPATH=$(P)/prof/share/swarm/swarm.jar libtool --mode=compile $(GCJ) 
 -c $(GCJFLAGS) -o jheatbugs.lo jheatbugs.jar

jheatbugs-prof: jheatbugs.lo depend.o
        libtool --mode=link $(GCJ) -all-static $(GCJFLAGS) -dlpreopen 
$(SWARMBUILD)/java/libgcjswarm.la -dlpreopen 
$(P)/prof/lib/swarm/libjavaswarm.la --main=StartHeatbugs -static jheatbugs.lo 
depend.o $(LIBGCJSWARM_LA) -o jheatbugs-prof

depend.o: depend.m
        gcc -c depend.m

Attachment: depend.m
Description: pulls in Swarm classes


reply via email to

[Prev in Thread] Current Thread [Next in Thread]