ASM

metracer — New Release 1.2.0

New version of metracer 1.2.0 was just released. Main changes are:

# Change Description
1 Use of ASM for instrumentation  A move was made towards ASM instrumentation framework instead of Javassist. This allowed to:

  • increase performance
  • lower memory footprint
  • get rid of creation of proxy methods – now a tiny pieces of code are injected directly into target methods
2 Reporting of return values Now there is information of return values of instrumented methods, e.g.:metracer_return_value_
3 Extended reporting of exceptions Now the string representation of exception is printed for instrumented methods, e.g.:metracer_exceptions

With these changes metracer became more efficient, lightweight. Changes provide an opportunity for “hot” code instrumentation (without program restart).

 

metracer – Java Code Instrumentation and Stack Map Frames

Stack Map Frames in Java is a contradictory addition to the language: they speed up class loading but the same time make big troubles for a code instrumentation tools. During adoption of an ASM framework to a metracer I have stumbled with following main two issues:

  1. necessity to resolve a “common super class” during instrumentation which causes many ClassNotFoundException
  2. VerifyError exceptions with message like ‘Stack map does not match the one at exception handler’

(more…)