Profiling a Java Application Launched from a Script (vtl)

This information applies to the command-line interface (vtl) only.

To collect call graph data for a Java application launched from a script:

  1. Create a script. Make sure to include the correct Java profiler option to Java command line in the script.

note

The command-line options for invoking the VTune analyzer's Java profiler depend on the Java version:

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

  1. 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

note

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

  1.  Configure your Activity and run it.

Command-line example:

>vtl activity -c callgraph -o java -app /tmp/run.sh run

note

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

See Also