Profiling using the Jopaz Profiler JAR Files
Note:
This approach is not recommended due to its increased susceptibility to errors.
1. Add the Jopaz Profiler JAR files to the CLASSPATH in jvm_conf.sh.
2. Create a new function get_profiler_runtime_dependencies in the configuration script using the JAR files.
Your input should look like this:
get_profiler_runtime_dependencies () {
profiler="${JPZ_INSTALLATIONPATH}"jpz-jar/jpzprofiler.jar
profiler="$profiler":"${JPZ_INSTALLATIONPATH}"jpz-jar/jacoco-core-0.8.7.jar
profiler="$profiler":"${JPZ_INSTALLATIONPATH}"jpz-jar/javassist.jar
CLASSPATH="$CLASSPATH":"$profiler"
}
3. Create an additional function get_profiler_JVM_execute_conf to enable the profiler invokation.
The function must contain the call -javaagent with some options:
get_profiler_JVM_execute_conf () {
IJ3=" -javaagent:"${JPZ_INSTALLATIONPATH}"jpz-jar/jpzprofiler.jar=profiler=;txt="${
JPZ_INSTALLATIONPATH}"/jpz-compiler/trace/hprof.$$.txt"
export IBM_JAVA_OPTIONS="$IBM_JAVA_OPTIONS $IJ3"
}
4. Add the function calls to the JZOS configuration. Edit or duplicate and edit the EXECCONF member to contain the following function calls:
readonly jpzlocation=/opt/softwareag/jpz
. "$jpzlocation"jpz-compiler/conf/jvm_default_conf.sh
get_default_lib_path
get_default_db2_conf
get_default_runtime_dependencies
get_default_JVM_execute_conf
get_profiler_runtime_dependencies
get_profiler_JVM_execute_conf
5. Run. You can find the profiler report in the trace directory of the Jopaz installation.