Mission
Harmony verifier extension is used to recalculate stack maps of a class after it is instrumented by TPTP.
TPTP Java Profiler Development Environment
The environment is used to debug the extension. For example, it allows writing a class file with a modified stack table down.
Requirements
- MS Windows, Visual C++ 6.0.
- Java JDK 1.5, 1.6.
- Environment variable:
JAVA_HOME=<full path to JDK 1.5 directory>
. - JDK header files (
jni.h
, jvmti.h
, and jvmpi.h
) are expected to be available under %JAVA_HOME%\include
.
Getting the Verifier Extension
No Format |
---|
cd <Harmony root>
svn co http://svn.apache.org/repos/asf/harmony/enhanced/trunk
cd working_vm
svn checkout build.xml vm/vmcore/src/verifier-3363/ vm/vmcore/include/ make/ vm/include/
|
Compiling the Verifier Extension
- Run a command prompt. Include VC6 and ant directories into
PATH
, INCLUDE
, and LIB
environment variables. - From
<Harmony root>\working_vm
invoke ant clean-verifier-ext verifier-ext
. - Copy the resulting library
<Harmony root>\working_vm\build\windows_x86_msvc_{debug|release}\deploy\lib\verifier-ext.lib
to <TPTP root>\org.apache.harmony_vmcore_verifier\lib\windows\\{debug|release}\IA-32\verifier.lib
.
Getting TPTP Sources
No Format |
---|
cd <TPTP root>
cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/tptp checkout \
platform/org.eclipse.hyades.probekit platform/org.eclipse.tptp.platform.jvmti.runtime
|
Compiling Martini
- Open
<TPTP root>\org.eclipse.tptp.platform.jvmti.runtime\src-native\build\tptp_martini.dsw
. - Select and build the
BuildMartini32
project. - Open
<TPTP root>\org.eclipse.tptp.platform.jvmti.runtime\src-native\build\tptp_profiler.dsw
. - Select and build
BuildCGProf32
project. - Select and build
BuildJPIAgent32
project. - All profiler binaries are now located (depending on whether you did release or debug build) in
org.eclipse.tptp.platform.jvmti.runtime\src-native\bin\windows\\{debug|release}\IA-32
.
Configuring Profiler Environment
- Open a command window and configure Java 6 (Sun or BEA) as the active JVM (no need to set JAVA_HOME).
- Add the directory containing profiler binaries to the system path and environment:
No Format |
---|
set JAVA_PROFILER_HOME=<TPTP root>\org.eclipse.tptp.platform.jvmti.runtime\src-native\bin\windows\{debug|release}\IA-32
set PATH=%JAVA_PROFILER_HOME%;%PATH%
|
Launching a Profiler
Wiki Markup |
---|
\[under construction\] Extract the attached {{ProxyClasses.zip}} into {{<TPTP root>}}. This should create the following directory structure: org\eclipse\tptp\martini, and place 3 class files there. |
- Launch the profiler on the Java2D workload (attached):
No Format |
---|
java -XX:-FailOverToOldVerifier -cp <TPTP root>\bin -agentlib:JPIBootLoader=JPIAgent:server=standalone,stackmap=true;CGProf java2d.Java2Demo
|
(Thanks to Asaf, Vasily)