This information applies to the command-line interface (vtl) only.
Create a script. Make sure to include the correct Java profiler option to Java command line in the script.
The command-line options for invoking the VTune analyzer's Java profiler depend on the Java version:
For Java 1.4, use the -Xrun option. For example: -Xrunjavaperf:cg.
For Java 5.0, use the -agentlib option. You may choose one of the following:
Add the -agentlib option to the java command. For example: -agentlib:javaperf:cg
Specify
it in the JAVA_TOOL_OPTIONS environment variable. For example:
>export JAVA_TOOL_OPTIONS=-agentlib:javaperf:cg.
Consider adding the option to the environment variable when
the Java application is invoked from a script.
where javaperf is a VTune analyzer's library. To use this library, make sure to install the VTune analyzer.
Command-line example:
date
echo $CLASSPATH
CLASSPATH=./jbb.jar:./jbb_no_precompile.jar:./check.jar:./reporter.jar:$CLASSPATH
export CLASSPATH
/mnt/nfs/Projects/VTune/java/ia32/jrockit-jdk1.5.0_02/bin/java -agentlib;javaperf:cg -Xms256m -Xmx256m spec.jbb.JBBmain -propfile /tmp/SPECjbb2000/SPECjbb.props
Specify the <install_dir>/analyzer/bin
directory in the LD_LIBRARY_PATH and the BISTRO_INSTALL_DIR environment
variables. For example:
LD_LIBRARY_PATH=/opt/intel/vtune/analyzer/bin:/opt/intel/vtune/shared/bin:$LD_LIBRARY_PATH
When profiling on systems with Intel(R) 64 architecture, using a 32-bit JVM, set the LD_LIBRARY_PATH environment variable as follows:
LD_LIBRARY_PATH=/opt/intel/vtune/rdc/analyzer/bin32:/opt/intel/vtune/rdc/shared/bin32:$LD_LIBRARY_PATH
Configure your Activity and run it.
Command-line example:
>vtl activity -c callgraph -o java -app /tmp/run.sh run
If the Java launcher is specified as an argument in the script, configure the Activity as follows:
>vtl
activity -c callgraph -o java -app /tmp/run.sh,
'/mnt/nfs/Projects/VTune/java/ia32/jre1.5.0_02/bin/java' run