JVM supported selective method entry/exit instrumentation
Original Publication Date: 2004-Jun-03
Included in the Prior Art Database: 2004-Jun-03
AbstractUsing the Java(*) Virtual Machine Profiling Interface (JVMPI) to instrument a Java program with all method entries and exits can cause excessive overhead. We describe a selective class instrumentation approach that can significantly reduce that overhead. This makes feasible a wide range of performance experiments to pinpoint performance problems.
JVM supported selective method entry /exit instrumentation
1.What is it?
Instrumenting entries/exits for selected Java methods.
Ability to run jprof (a java profiling agent) with only selective instrumentation of items, like packages, classes, specific methods ( method entry / exit ).
Less overhead, longer running, ability to focus on high level application interfaces (API's)
3. Requires a specially instrumented Java Virtual Machine (JVM) that allows methods or classes to be marked for instrumentation. The profiler identifies the methods/classes to be instrumented by making a call back to the JVM while the classes are loaded. The Just In Time (JIT) compiler generates instrumentation for those methods that are marked and the JVM only issues the entry/exit events for the marked methods/classes.
We define a new jprof option. cfilter=fnm, that allows us to read a file containing class prefixes. Also a new JVMPI Event. that sets up the SelClassMode in JVM.
java -Xrunjprof:rtarcf,ptt_insts,cfilter=fnm hellop 5000
A callback interface in the JVM is defined that allows the profiler to mark methods/classes in the JVM. Then during ClassLoad these file class-prefixes are used to mark each class/method as instrumentable or not.
5.cfilter file example:
fnm entries are left-justified, with 1 prefix per line. If any class matches a prefix then it will be instrumented.
This will result in any method in a class that matches these 3...