Browse Prior Art Database

JVM supported selective method entry/exit instrumentation

IP.com Disclosure Number: IPCOM000028823D
Original Publication Date: 2004-Jun-03
Included in the Prior Art Database: 2004-Jun-03
Document File: 1 page(s) / 32K

Publishing Venue

IBM

Abstract

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

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 96% of the total text.

Page 1 of 1

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 ).
2.Why?

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.
4.User control:

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.

java/lang

java/String

sun

This will result in any method in a class that matches these 3...