FERRARI: Framework for Exhaustive Rewriting and Advanced Runtime Instrumentation 

 

Overview

FERRARI is a framework allowing bytecode instrumentation of application code and standard Java class library (JDK) classes.


FERRARI is neither an application-specific framework nor a low-level bytecode instrumentation toolkit.

Instead, it generates the necessary program logic to enable custom instrumentation of the Java class library and of application classes.


FERRARI solves the problem of bootstrapping the JVM with an instrumented Java class library.


FERRARI allows full coverage of bytecode instrumentation.


FERRARI is implemented in pure Java, and does not rely on native code or modified JVM.


FERRARI provides a flexible interface enabling different user-defined instrumentation modules (UDIs),

which may be written in pure Java, to control the instrumentation process.

Disclaimer: The FERRARI framework is a research project funded by Swiss National Foundation, and has no relation with the famous italian Ferrari car company.

User Defined instrumentation (UDI)

FERRARI static tool and dynamic agent

FERRARI sends classes as byte arrays to the UDI, and the UDI modifies the class and returns with additional information about the methods that have been modified. This information is used by FERRARI to create the necessary program logic to bypass instrumented code during bootstrapping, and to temporarily bypass instrumented code to avoid infinite recursions.


UDIs  are free to use any bytecode instrumentation framework (e.g., BCEL, ASM, Javassist, Soot..)


We have implemented the following UDIs for FERRARI:


  1. -AJ-UDI : UDI for Aspect Weaving

  2. -CC-UDI : UDI for Calling Context Reification

  3. -JP-UDI : UDI for Profiling


The following tools are based on FERRARI and UDIs:

  1. -MAJOR : A tool for aspect weaving with full coverage (uses the AJ-UDI)

  2. -CARAJillo : A tool for Calling Context Reification for Aspects (Combines AJ-UDI and CC-UDI)

  3. -ParCCT : A tool for parallelizing the creation of complete and accurate Calling Context Trees (CCT)

  4. -CProf : A cross-profiling tool for embedded Java Processors

FERRARI has a static tool for JDK instrumentation, and a dynamic agent for load-time instrumentation. The dynamic agent is based on standard java.lang.instrument API.

The static tool is called FIRST (Ferrari Instrumentation and Rewriting Static Tool)



Bootstrap and bypass SUPPORT

application DOMAINs

FERRARI has been successfully applied in the following domains:


  1. -Profiling

  2. -Debugging

  3. -Reverse engineering

  4. -Cross-Profiling for embedded Java Processors (collaboration with Martin Schoeberl from Technical University of Vienna, Austria.)



Bootstrap Inserted-code Bypass (BIB) is a mechanism based on a global flag used by FERRARI to bypass instrumented code during the bootstrap of the JVM.


Dynamic Inserted-code Bypass (DIB) is a mechanism used by FERRARI to bypass instrumented code, e.g. during dynamic instrumentation. The DIB mechanism enables selective per-thread bypassing of instrumented code, which allows to temporarily revert to the original, non-instrumented code.