-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model based instrumentation #58
Comments
The current implementation only inserts one invocation into the loop. Chained or nested invocations are left outside of the loop. |
To improve the current instrumentation implementation we should introduce a clean event api that can publish events to registered observers without changing the instrumented code. Therefore, we should add an API like the previously, Groovy specific static void VRLInstrumentationUtil.__preEvent(...)
static void VRLInstrumentationUtil.__postEvent(...) and ideally invocation generators that generate the static method calls in the corresponding model: static void VRLInstrumentationUtil.generatePreEvent(...)
static void VRLInstrumentationUtil.generatePostEvent(...) |
this should be sufficient for visualizing instrumentation events (issue #58) TODO investigate whether id generation should be inside object initialization or inside the code-builder
- custom instrumentatin event handlers can be added to VRLInstrumentationUtil
- timestamp works, toString implemented for logging and debugging
- timestamp works, toString implemented for logging and debugging
- timestamp works, toString implemented for logging and debugging
temporary indent argument removed since debugging can now be done with much more accurate event handling api
(before, we only visualized return values) issue #58
- return statements need to be executed after post-event (since nothing gets executed after return)
- return statements need to be executed after post-event (since nothing gets executed after return)
Event generation for return statements has a bug (no event can be fired after returning from a method). Example: __vrl_reserved_intermediate_var_6);
VRLInstrumentationUtil.__preEvent("14", "return",
__vrl_reserved_intermediate_var_6);
return __vrl_reserved_intermediate_var_6;
VRLInstrumentationUtil.__postEvent("14", "return");
} Therefore, we need to swap the return statement invocation and its post-event invocation: __vrl_reserved_intermediate_var_6);
VRLInstrumentationUtil.__preEvent("14", "return",
__vrl_reserved_intermediate_var_6);
VRLInstrumentationUtil.__postEvent("14", "return");
return __vrl_reserved_intermediate_var_6;
} The same applies to continue and break. |
Instead of a Groovy based transform we need a model based instrumentation in the future to ensure that instrumentation also works for other (potential) language bindings. Instead of a special utility method the idea is to directly insert pre/post events into the source.
Example 1:
will be transformed to something like:
For chained invocations and operators we need to introduce additional tmp-variables:
Example 2:
will be transformed to something like:
We will also need to introduce a mapping between events and visual nodes to use the instrumentation from the ui.
Loops:
Loops need special treatment:
will be transformed to:
For complex condition arguments we need to extract the whole invocation chain and move it into the while loop.
The text was updated successfully, but these errors were encountered: