Navigation auf uzh.ch
Dynamic footprinting consists of executing the operation on the model while recording a trace of this execution - a set of events that occurred during the execution of an operation. The dynamic (actual) model footprint of an operation can then be established from its execution trace with a simple book-keeping algorithm.
To compute the dynamic footprint of an operation, we are interested in two kinds of execution events: accesses to objects' state and invocations of operations on objects. These events occur when Kermeta interprets a CallFeature object in the abstract syntax tree of the transformation.
Thus, we modify the class org.kermeta.interpreter.internal.CallFeatureInterpreter to store, for every CallFeature object being interpreted, the model object targeted by the CallFeature and the property or operation called by the CallFeature object.
This information can be stored in the RuntimeMemory of the interpreter. We extend this class to store trace events in an EMF model, whose metamodel is shown below. Once the execution of the Kermeta transformation is terminated, the AbstractKInterpreter saves the EMF model into a file.
The following files extend or modify the interpreter of Kermeta (located in the fr.irisa.triskell.kermeta.interpreter plugin of the Kermeta distribution). They are based on version 1.32 of Kermeta.
kermeta_execution_trace.ecore is the Ecore metamodel for Kermeta execution traces. It contains references to both Ecore and Kermeta metamodels.
The book-keeping algorithm extracting the footprint from an execution trace is implemented in Java: